0

By convention, stdout is -. Is there something similar for stderr?

6
  • 1
    - 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 Commented Mar 3, 2023 at 6:36
  • 1
    Can you think of any place where a similar thing as - could be useful for representing the standard error stream? Commented Mar 3, 2023 at 6:38
  • 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. Commented Mar 3, 2023 at 11:50
  • @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. Commented Mar 3, 2023 at 22:25
  • @StéphaneChazelas This has no relevance to the question. Commented Mar 3, 2023 at 22:26

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.