How can I automatically exit vim via a bash command in a .sh file? - Ask Ubuntu


i writing bash script (.sh file) run program called "lenstool". before running type directly in terminal, "lenstool" opens text file in vim. must quit vim typing :q , hitting enter. program supposed do. now, want run "lenstool" few thousand times. how can automatically exit vim within bash script file?

one solution comes mind doing:

id=$(ps -a | grep vim | awk '{print $1}') 

to pid(s) of running vim program(s) , kill with:

kill $id 

of course need save work first , this. i'm not sure how program saves has done!


Comments

Popular posts from this blog

download - Firefox cannot save files (most of the time), how to solve? - Super User

windows - "-2146893807 NTE_NOT_FOUND" when repair certificate store - Super User

sql server - "Configuration file does not exist", Event ID 274 - Super User