Gerard Beekmans wrote:
> Anyway here it is, doesn't get much shorter (4 lines):
>
> for line in $(cat twtest.txt); do
> sed "s|^$line|#$line|" twpol.txt > twpol.txt.new
> mv twpol.txt.new twpol.txt
> done
sounds like twtest.txt has a 'Filename: ' prefix on each line, so you
may wanna insert a line like this before the sed command
line="${line#Filename: }"
also, if you have perl, it can edit files in place (maybe sed can too,
don't know), so the sed line could be replaced with
perl -pi -e "s|^$line|#$line|" twpol.txt
in which case you can get rid of the `mv` line
Dave