The zathura man page states
zathura displays the given files. If a single hyphen-minus (-) is given as file name, the content will be read from standard input. If no files are given, an empty zathura instance launches.
Indeed, this works in bash if I run the command cat document.pdf | zathura -
. However, I am unable to generalize this to other cases. Specifically, if I create a folder containing only document.pdf
, running the command ls | zathura -
returns an error, saying that zathura could not determine the file type. Why is this? Am I misunderstanding how piping works?
cat document.pdf | zathura -
Pipes the content of document.pdf
to Zathura, which tries to render it.
ls | zathura -
If you have only document.pdf
directory and nothing else, that pipes the string document.pdf
to Zathura, not its contents, so Zathura complains. Moreover, if you try to write a program and it involves parsing ls
, you are most probably doing it wrong.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments