[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] UNIX Perl problem



On Sat, Sep 30, 2000 at 03:31:14PM +0000, Sveinbjorn Thordarson wrote:
} 
} I'm sorry I wasn't clearer in my first message.  The "Use Shell.pm" was a
} stupid typing mistake on my behalf, as was the omission of qw(write), by the
} way.  I'm not quite that new to Perl.  However, I need to be able to send a
} different message to various users when they telnet into the Linux box at
} regular intervals.

You let users telnet in????  Do you realize the security implications
of letting users log in while typing their passwords in the clear
across the network?  Either get a telnetd that allows you to use a one
time password scheme like OPIE or S/Key, and wrap the telnetd using
hosts.{allow,deny} tightly.  Or tell your users to use ssh, which is a
far better alternative these days.

If you only want the message to appear when they log in, in old BSD
(4.0, 4.1) there was just such a facility.  I don't know whether it's
still around, and I no longer remember what it was called (msgs,
perhaps).  Maybe it's still around in the *BSD's.  If so, you can
probably easily port the source.

} I was planning on using cron, and a perl script that
} uses who and write.  wall won't work because it targets everyone.  The
} message must be instantaneous and appear in the user's terminal.  Is there
} anything that lets you send a text message to a user in a single line?

Not reliably.  If the user is expecting the message and allows it,
then write will work.  If not, then it's not so easy, since users can
block such messages from other normal users (man mesg) , and they may
not be paying attention to the tty you decide to write to, unless you
write to all of them they have open.  As I said, using email is a
better alternative these days.

} 
} How do I print into the write command and then end it with the Control-D?
} That's the real issue.

Just as Axel just said.  Open a pipe to write.

} 
} Thanx,
} 
} Sveinbjorn Thordarson
} 
} 

-- 
Paul Schinder
schinder@pobox.com

# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org