Tuesday, April 24, 2012

How I can run vim commands from a bash script?

I am trying to write an script to execute a vim command to multiples txt files and to overwrite these txt with the result. Something like that.

#!/bin/sh
for i in *.txt; do vim ":%s/foo/bar/g"; done

How I can run vim commands from a bash script? What I am doing bad?

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment