Is there a magic file name that gives the following effect?

$ mkfifo /tmp/fifo1 && cat /tmp/fifo1 &
$ foo --log-file /tmp/fifo
# now I can see the log as the program runs

I want something like

$ foo --log-file /proc/to_stdout
  • It would be worth specifying the OS in questions like this. – Chris Down May 28 '12 at 11:36
  • I was hoping there was an answer for all (or all usable) unices... – Elazar Leibovich May 28 '12 at 15:23
  • There isn't, as far as I'm aware. – Chris Down May 28 '12 at 15:28

You're looking for /dev/stdout or /dev/stderr as appropriate.

  • 3
    Which are symlinks to /proc/self/fd/1 and /proc/self/fd/2 respectively — the /dev entries may be absent, but the /proc ones are guaranteed to be there if proc is mounted. – Alexios May 28 '12 at 10:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.