-bash-4.1# cat output
"/root/mail/domain.com/root/Archive Dir.2012.04 April"
for i in `cat output`; do echo "$i"; done
"/root/mail/domain.com/root/Archive
Dir.2012.04
April"
I want them on a single line, as they are originally stored in the file. Is it echo's fault?
echo -n
will break everything, so it won't do.
You can use a while loop
The reason why your command doesn't work as you expect is that
for
operates on words. The value of the $IFS variable determines what characters are used to delimit words, the default isspace
,tab
andnewline
. As your input file contains lines that have spaces they are being spit into words. If you need to use a for loop you can work around this by wraping your lines in"