vim tasks in shell script

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

vim tasks in shell script

Post by knzzz » 2018/08/09 05:17:17

Hi Team,

Is it possible to do the basic vim edition tasks using the shell script

for eg:

%s/search/replace/g

is it possible to do the above example using shell script with editing it manually.

Regards
Kanna

User avatar
jlehtone
Posts: 4530
Joined: 2007/12/11 08:17:33
Location: Finland

Re: vim tasks in shell script

Post by jlehtone » 2018/08/09 06:12:17

To edit a file is not a "vim task". It is a "edit" task. There are many ways to edit files. Vim is only one of them. sed is an another.

Code: Select all

man sed
info sed
Yes, it is possible to edit files with a script.

desertcat
Posts: 843
Joined: 2014/08/07 02:17:29
Location: Tucson, AZ

Re: vim tasks in shell script

Post by desertcat » 2018/08/09 09:54:33

jlehtone wrote:
2018/08/09 06:12:17
To edit a file is not a "vim task". It is a "edit" task. There are many ways to edit files. Vim is only one of them. sed is an another.

Code: Select all

man sed
info sed
Yes, it is possible to edit files with a script.
You can also edit it with mc (Midnight Commander).

Post Reply