1
I have a large amount of log files that I need to remove sensitive data from. The sensitive data is provided to me in a text file and is prone to change.
I had hoped to do the equivalent of this:
#!/usr/bin/bash
pattern=""
for val in 'sed -e 's/.*=//' Client_clean.txt
do
pattern=$pattern$val"|"
done
#egrep -e $pattern $1
sed -i 's/$pattern/CLIENT/g' $1
exit 0
The commented out egrep works fine, the sed doesn't.
Am I right to use sed for this? Or is there a more apt route to take?
Any help appreciated.
Steve
Thanks so much, worked like a charm. I hadn't realized the problem with the delim character at the end either, so thanks for that too. – Steve – 2011-02-21T19:20:22.373