This question already has an answer here:
$ mkdir testdir $ cd testdir $ echo | tee "file name"
ls will print
file?name (under Ubuntu GNU bash, at least), while
ls | cat will print
name in separate lines.
What I'd like to achieve is, print
file?name with the piped version, so something like
$ something ls | cat` or `ls | something | cat` or `ls | something cat
In other words, how to fool a command like
ls here into thinking, it has a TTY, when it does not, in the shell?
ls is just an example program here, I'm looking for generic solution, not program specific like
ls -q | cat would be.