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

Re: Using program output for a MOTD file

On Fri, May 17, 2002 at 04:32:54PM +0930, Tom Cook wrote:
> On  0, Brandt Dusthimer <brandt@dusthimers.com> wrote:
> > As bonkers as this might seem, does any one know if there is any way of
> > setting up a file (like a motd file) so that it uses the output of a
> > program like fortune?
> I think if you could get fortune to write to a FIFO then you would be
> laughing.  If you don't mind using something other than fortune, then
> signify handles this fairly gracefully.  Try something like this:
> rm /etc/motd
> mkfifo /etc/motd
> signify --fifo=/etc/motd --input=/etc/logout-messages
> cat /etc/motd
> You will, of course, need to supply a list of logout messages
> appropriate for your site.

Or combine the two:

# cat > /etc/motd.signify <<!
% { exec
% }
# mv /etc/motd /etc/motd.orig
# mkfifo /etc/motd
# signify --fifo=/etc/motd --input=/etc/motd.signify &
# cat /etc/motd

Karl E. Jørgensen
==== Today's fortune:
Did you know that if you took all the economists in the world and lined
them up end to end, they'd still point in the wrong direction?

Attachment: pgpmvnSbmZtlZ.pgp
Description: PGP signature

Reply to: