-1

Why does | more take no effect for some programs, when run in bash?

I get that behavior with leiningen, not really a command but a program. I think indeed it happens in cases where the output is sent to stderr. I'll be confirming that.

  • 4
    An example of such a command, perhaps? – ilkkachu Oct 29 '16 at 10:02
  • 3
    Most likely because said commands don't send their output to stdout. – Satō Katsura Oct 29 '16 at 10:03
  • I get that behavior with leiningen, not really a command but a program. I think indeed it happens in cases where the output it sent to stderr. I'll be confirming that. – Matan Oct 29 '16 at 10:33
  • 1
    Theoretically a program could also check what pipe stdout points to and then depending on this misbehave but I don't you would be coming across such a case in the real world. – phk Oct 30 '16 at 8:37
5

The pipe symbol ("|") connects the STDOUT stream from the left side process to the STDIN stream of the right side process. It sounds like your program is outputting to STDERR.

You can send STDERR to STDOUT, and both to the pipe via:

program 2>&1 | more
  • 3
    Since this is bash, there is a shortcut. You can replace 2>&1 | with |&. – icarus Oct 29 '16 at 13:13

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.