
August 2nd, 2011, 08:45 AM
|
|
|
Having actually tried the code now (and having had to correct the error in the second one (removing the extraneous "), plus adding -e to the echo (needed as I am using bash under Linux to have the \c work)) they have all worked as planned. Indeed, as I suspected, your code also works, which makes me think that the source of the problem is your file. I suspect you have blank lines interspersed within it - add a pipe to your cat to remove them: (| grep -v "^$") and see how that goes:
Code:
for test in `cat files.lst | grep -v "^$"`; do echo $test".txt"; done
|