musther
May 16th, 2006, 01:44 AM
In the thread:
http://ubuntuforums.org/showthread.php?t=170129
I asked for help making a script to do multiple find/replace operations on a text file based on a config file with one line per operation.
The eventual bit of script we came up with was this:
for x in `cat ttspd`
do
f1=`echo $x | cut -d\' -f2`
f2=`echo $x | cut -d\' -f4`
sed -i -e s/\\\<$f1\\\>/$f2/gI text.txt
done
The lines in the config file are like this:
'foo'='bar'
So, I would like to put comments in the config file 'ttspd' in the usual linuxy fasion '# comment', is there an easy way to make this loop ignore lines starting with #?
Cheers!
http://ubuntuforums.org/showthread.php?t=170129
I asked for help making a script to do multiple find/replace operations on a text file based on a config file with one line per operation.
The eventual bit of script we came up with was this:
for x in `cat ttspd`
do
f1=`echo $x | cut -d\' -f2`
f2=`echo $x | cut -d\' -f4`
sed -i -e s/\\\<$f1\\\>/$f2/gI text.txt
done
The lines in the config file are like this:
'foo'='bar'
So, I would like to put comments in the config file 'ttspd' in the usual linuxy fasion '# comment', is there an easy way to make this loop ignore lines starting with #?
Cheers!