Skip to main content
8 events
when toggle format what by license comment
Mar 3, 2023 at 22:36 comment added Kusalananda Hmmm... I'm not sure I understand the semantics. If certain messages are sent to a file whose argument can be - to signify standard output, what would stop you from sending error messages to the standard error stream and letting the user redirect that? Or do you need a filename? It would be good to see a real application that would require this. Some utilities use -o and -e as options taking arguments that are filenames where the utility will save output and error messages, but it's uncommon. These would just use stdout and stderr as usual if the options were not given.
Mar 3, 2023 at 22:26 comment added midrare @StéphaneChazelas This has no relevance to the question.
Mar 3, 2023 at 22:25 comment added midrare @Kusalananda It's for a CLI argument for a program of mine. I want to allow the user to configure where certain log messages go. A - filename directs certain messages to stdout. I want something similar for stderr.
Mar 3, 2023 at 11:50 comment added cas No, but if you want to pipe stderr into a program, see Piping STDERR vs. STDOUT and Pipe STDOUT & STDERR separately. There are also lots of other questions and answers about piping stderr on this site.
Mar 3, 2023 at 6:38 comment added Kusalananda Can you think of any place where a similar thing as - could be useful for representing the standard error stream?
Mar 3, 2023 at 6:36 comment added Stéphane Chazelas - can be a place holder for stdout in contexts that expect a file that is written to (like tar cf -), or stdin in contexts that expect a file that is read from (like paste -, diff - file) or several other things. For instance for cd, - means the previous directory. - is also use as the option delimiter for most Bourne-like shells and builtins of the Bourne/Korn/Z shells. See also patch -r - where - means discard
Mar 3, 2023 at 5:35 review Low quality posts
Mar 3, 2023 at 8:50
Mar 3, 2023 at 5:15 history asked midrare CC BY-SA 4.0