2 ms·
<file-that-doesnt-exist.txt less You get a blank screen, but if you do: cat file-that-doesnt-exist.txt | less You get a nice error message: cat: 'file-that-
by flukus 9y ago
<file-that-doesnt-exist.txt less
You get a blank screen, but if you do:
cat file-that-doesnt-exist.txt | less
You get a nice error message:
cat: 'file-that-doesnt-exist.txt': No such file or directory
- Tepix 9y agoWorks for me: $ < not_existant_file less bash: not_existant_file: No such file or directory I just tried this on bash 4.3. Cat remains superfluous in this case.
- flukus 9y agoJust tried it again and you're right it does produce an error, I was sanitizing a real error I just had though. With the real one I had an unescaped space, cat mentioned that it couldn't open "both" files, in just gave me a message about and "ambiguous redirect"