https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/wall.1.html
The OS X man
page seems to be almost identical to the Linux one, at least at the beginning, wherein it mentions where the command takes input from. It states STDIN by default. However it doesn't mention needing superuser
for reading from file, unlike the Linux man
.
Consequently, reading from a file seems to be default behaviour, and wall
on OS X simply looks for a file regardless of whether I've given given it a filename or an actual message, failing in the latter case.
As a stopgap I've been using a heredoc to send messages through wall
How do I make wall read from STDIN like it mentions in the manual?
Running OS X 10.10.3
EDIT: I'm not writing a script, I'm just typing in wall hello world
into a zsh
shell in Terminal on OS X. Same results with bash
and sh
.
EDIT 2: The response from the shell is actually
usage: wall [-g group] [file]
or
no such file or directory
(if I surround the message with quotes)
wall hello world
into a zsh shell in Terminal on OS X.wall
reads from stdin just fine. When you runwall hello world
, you're specifying the message on the command line, not stdin.echo hello world | wall
works. How does the Linux wall work then? It seems to automatically decide on taking the subsequent input as STDIN or a filename if it exists