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