vim through shell scipt

General support questions
Post Reply
knzzz
Posts: 115
Joined: 2017/02/25 12:41:42

vim through shell scipt

Post by knzzz » 2018/02/22 06:32:06

Hi Team,

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


Regards
Kanna

pjsr2
Posts: 314
Joined: 2014/03/27 20:11:07

Re: vim through shell scipt

Post by pjsr2 » 2018/02/22 09:51:42

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.

cen
Posts: 12
Joined: 2018/02/20 15:07:57

Re: vim through shell scipt

Post by cen » 2018/02/22 14:43:08

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.

Post Reply