vim through shell scipt

General support questions
Posts: 89
Joined: 2017/02/25 12:41:42

vim through shell scipt

Postby 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


Posts: 282
Joined: 2014/03/27 20:11:07

Re: vim through shell scipt

Postby 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.

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

Re: vim through shell scipt

Postby 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.