I am trying to read the entire file in a variable without deleting any characters. I'm sure it should be stupidly simple.
This does not work as it removes duplicate spaces, all tabs and newlines:
$ echo 'fred wilma' > somefile; z=$(cat somefile); echo $z fred wilma
I see that the same filtering happens with a simple purpose:
$ z='fred wilma'; echo $z fred wilma
but not when I do this:
$ echo 'fred wilma' fred wilma
How do I get a bash variable to stop being parsed and filtered on assignment?
source share