Chris G cl@isbd.net wrote:
However the problem is that using 'echo' to see what you have done is totally useless as echo does so many clever things under the cover that you don't get to see what's actually in the variable at all.
If you do the above and then say "echo $fred" you just get:-
That's bash doing the "clever" thing not echo. The command you want to use to check is: echo "$fred" ...which stops bash fiddling with the whitespace before passing it to echo (same happens with both the builtin and /bin/echo).
Hope that helps,