in reply to unix write command through system
The system write command takes its message from STDIN, so you can pipe your text into it. The preferred way to do that in perl would be through piped ('magic') open,
{ open my $foo, '|-', "/usr/bin/write $user $tty" or die $!; print $foo 'message here'; close $foo or die $!; }
Be cautious how you use this, write is usually regarded as a nuisance, if not an intrusion. The only place it is really accepted is in shutdown messages from root.
After Compline,
Zaxo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: unix write command through system
by sgifford (Prior) on Oct 19, 2003 at 06:57 UTC | |
by Jimbobbob (Initiate) on Oct 19, 2003 at 16:15 UTC | |
by etcshadow (Priest) on Oct 20, 2003 at 03:08 UTC |