mars/rename.sh

15 lines
244 B
Bash
Raw Normal View History

2010-08-05 15:54:48 +00:00
#!/bin/bash
old=backup.$$
files="*.h *.c"
#files="mars_buf.h mars_buf.c"
mkdir -p $old || exit $?
cp -a $files $old || exit $?
for i in $files; do
sed "$1" < $i > $i.tmp || exit $?
cmp $i $i.tmp || mv $i.tmp $i
rm -f $i.tmp
done