250 |
kaklik |
1 |
#!/bin/bash |
|
|
2 |
# $Id: remove_message.sh,v 2.0 2003/11/18 15:20:39 nijel Exp $ |
|
|
3 |
# |
|
|
4 |
# Shell script that removes a message from all message files (Lem9) |
|
|
5 |
# it checks for the message, followed by a space |
|
|
6 |
# |
|
|
7 |
# Example: remove_message.sh 'strMessageToRemove' |
|
|
8 |
# |
|
|
9 |
|
|
|
10 |
if [ $# -ne 1 ] ; then |
|
|
11 |
echo "usage: remove_message.sh 'strMessageToRemove'" |
|
|
12 |
exit 1 |
|
|
13 |
fi |
|
|
14 |
|
|
|
15 |
for file in *.inc.php |
|
|
16 |
do |
|
|
17 |
echo "lines before:" `wc -l $file` |
|
|
18 |
grep -v "$1 " ${file} > ${file}.new |
|
|
19 |
rm $file |
|
|
20 |
mv ${file}.new $file |
|
|
21 |
echo " lines after:" `wc -l $file` |
|
|
22 |
done |
|
|
23 |
echo " " |