Consider the following echo command:
echo -e "at\r"
which produces the output at
on the command line, i.e. the \r special character has been interpreted. I want to do the exact same thing with some text in a file. Supposing the exact same sequence
at\r
is written to a file named at.txt
, then I want to display it on the terminal. But
cat at.txt
gives the output
at\r
what is not what I want. I want the special sequence \r to be interpreted, not just printed on the terminal. Anyone any idea?
Thanks Alex
echo -e "$(cat file)"
work? (For small files)cat file | xargs echo -ne
xargs
uses \ as a special character. To fix this you can tell it to not to:cat file | xargs --null echo -ne