Page 1 of 1

vim through shell scipt

Posted: 2018/02/22 06:32:06
by knzzz
Hi Team,

using shell script is it possible to do the vim edition like appending and search , replace


Regards
Kanna

Re: vim through shell scipt

Posted: 2018/02/22 09:51:42
by pjsr2
Yes, you can do that. Read "man vim" and look at the options -c and -s (and optionally -w).

For search and replace of text in files from a shell script, you also should have a look at the sed stream editor.

Re: vim through shell scipt

Posted: 2018/02/22 14:43:08
by cen
Awesome "pjsr2", I never know that before.

My workflow will be use grep/egrep + sed + awk to do common text manipulation, plus perl and regex for advanced cases.

In the sys/db/mid admin domain, I believe it is enough for 99.99%. If not, go to python/ruby.