linux - How to save another configuration file in the shell.
怪我咯2017-05-16 13:22:42
0
3
672
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)
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
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 statementecho "Content to be inserted" >>/abc.conf This will directly append content to the file.
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