f=`cat foo.txt` # f will contain the entire contents of the file printf '%s\n' "$f"