1. How to write in the shell:
Save the vim configuration file
For example, if a file is called abc.conf
To write in the shell:
vim /abc.conf
i How to save and exit after key insertion and modification
(not directly wq/ZZ in vim)
伊谢尔伦2017-05-16 13:24:42
If you want to modify it through script/abc.conf
, 那就别用vim
, 可以尝试下sed/awk
, if necessary, you can describe the problem in more detail and I can provide the corresponding statement
曾经蜡笔没有小新2017-05-16 13:24:42
echo "Content to be inserted" >>/abc.conf This will directly append content to the file.
世界只因有你2017-05-16 13:24:42
Vim is interactive, and the shell script is a new shell. How do you open an interactive editor in a new shell? . . You should just use sed