3 added 122 characters in body
source | link

Using ex (which is equivalent to vi -e/vim -e).

One file:

ex +"g/local/s/$/;/g" -cwq foo.txt

All test.txt files recursively:

ex +"bufdo g/local/s/$/;/g" -cxa **/test.txt

If extended globbing doesn't work (**), enable it via: shopt -s globstar.Note: Make sure that globbing option (**) is enabled by: shopt -s globstar if your shell supports it.

Note: The :bufdo command is not POSIX.

Using ex (which is equivalent to vi -e/vim -e).

One file:

ex +"g/local/s/$/;/g" -cwq foo.txt

All test.txt files recursively:

ex +"bufdo g/local/s/$/;/g" -cxa **/test.txt

If extended globbing doesn't work (**), enable it via: shopt -s globstar.

Note: The :bufdo command is not POSIX.

Using ex (which is equivalent to vi -e/vim -e).

One file:

ex +"g/local/s/$/;/g" -cwq foo.txt

All test.txt files recursively:

ex +"bufdo g/local/s/$/;/g" -cxa **/test.txt

Note: Make sure that globbing option (**) is enabled by: shopt -s globstar if your shell supports it.

Note: The :bufdo command is not POSIX.

2 added 126 characters in body
source | link

Using ex (which is equivalent to vi -e/vim -e).

One file:

ex +"g/local/s/$/;/g" -cwq foo.txt

All test.txt files recursively:

ex +"bufdo g/local/s/$/;/g" -cxa **/test.txt

If extended globbing doesn't work (**), enable it via: shopt -s globstar.

Note: The :bufdo command is not POSIX.

Using ex (which is equivalent to vi -e/vim -e).

One file:

ex +"g/local/s/$/;/g" -cwq foo.txt

All test.txt files recursively:

ex +"bufdo g/local/s/$/;/g" -cxa **/test.txt

If extended globbing doesn't work (**), enable it via: shopt -s globstar.

Using ex (which is equivalent to vi -e/vim -e).

One file:

ex +"g/local/s/$/;/g" -cwq foo.txt

All test.txt files recursively:

ex +"bufdo g/local/s/$/;/g" -cxa **/test.txt

If extended globbing doesn't work (**), enable it via: shopt -s globstar.

Note: The :bufdo command is not POSIX.

1
source | link

Using ex (which is equivalent to vi -e/vim -e).

One file:

ex +"g/local/s/$/;/g" -cwq foo.txt

All test.txt files recursively:

ex +"bufdo g/local/s/$/;/g" -cxa **/test.txt

If extended globbing doesn't work (**), enable it via: shopt -s globstar.