diff options
author | Markus Uhlin <markus@nifty-networks.net> | 2025-10-04 13:19:04 +0200 |
---|---|---|
committer | Markus Uhlin <markus@nifty-networks.net> | 2025-10-04 13:19:04 +0200 |
commit | 846d9b7da075604306e08936a1a625880eab03c0 (patch) | |
tree | c0a0ace68c17e6f7859690e768335dc7a8d0bde8 /FICS/rename-pattern | |
parent | 79d0f85be5641b7364a43c749720c5d3559ea5f3 (diff) |
Added a script
Diffstat (limited to 'FICS/rename-pattern')
-rwxr-xr-x | FICS/rename-pattern | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/FICS/rename-pattern b/FICS/rename-pattern new file mode 100755 index 0000000..09916b8 --- /dev/null +++ b/FICS/rename-pattern @@ -0,0 +1,22 @@ +#!/bin/sh + +TARGETS=" +*.c +*.cpp +*.h +*.hpp +" + +if test $# != 2; then + echo "error: bogus number of arguments" + exit 1 +fi + +if test -z "$1"; then + echo "error: first argument is of zero length" + exit 1 +fi + +for target in $TARGETS; do + sed -i "s/$1/$2/g" "$target" +done |