Why does echo foo | wall work but cat | wall not work? In the latter case, I enter a couple lines into cat, and in theory they should pipe to wall; however, nothing happens.


wall doesn't send each line of its input as a separate message. It collects the entire input so that it can send a single Broadcast Message from ... heading before the message, rather than sending a separate heading for each line.

If you want to process the input a line at a time, you can insert a loop between cat and wall:

cat |while read -r line; do wall <<<"$line"; done
| improve this answer | |
  • 1
    cat not needed here. – Kusalananda Feb 10 '18 at 21:22
  • @Kusalananda Just trying to match the question. I assume that the real application will be piping something else and this is a placeholder. – Barmar Feb 10 '18 at 21:24

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.