in reply to Re: unix write command through system
in thread unix write command through system
The appropriateness of using write varies from culture to culture. In places where I've worked, it's never been regarded as a particular nuisance, although I don't believe we had automatic programs using it.
Anyways, for very short messages, something like this will work just as well, and be a little bit simpler:
system("echo '$message' |/usr/bin/write '$user' '$tty'");
Also, keep in mind that all of the techniques posted have been horribly insecure if you don't have control over the contents of all shell parameters. Consider what would happen if $user was set to:
.'; rm -rf /; echo '
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: unix write command through system
by Jimbobbob (Initiate) on Oct 19, 2003 at 16:15 UTC | |
|
Re: Re: Re: unix write command through system
by etcshadow (Priest) on Oct 20, 2003 at 03:08 UTC |