On Sun, 29 Dec 2002 13:24, Stephen Kuhn wrote:
> On Sun, 2002-12-29 at 11:08, mike wrote:
> > I was wondering how you use these programs.I found the man page for
> > "Fortune" but nothing for these other thingies.
> >
> > Mike
>
> FORTUNE lies in /usr/games - hence, not in the path.
>
> You can create a symlink to the binary, though - by doing:
>
> ln -s /usr/games/fortune /usr/bin/fortune
>
> ...the fortune datafiles lie in /usr/share/games/fortune - so if
> download heaps of dat files for fortune, you can have thousands and
> thousands of non-repeating fortunes - jeepers!
>
> You can do amazing things with those fortunes - such as how a custom
> signature is created...the following is an example of the script that I
> use to generate a new signature every five minutes (running the script
> through KCron):
> ----------------------------------------------------------------------
> date > /tmp/date.txt
> fortune > /tmp/fortune.txt
> uptime > /tmp/uptime.txt
>
>
> sed r /tmp/date.txt /tmp/uptime.txt > /tmp/mdate.txt
>
> sed r /tmp/mdate.txt /root/signature.txt > /tmp/signature_temp.txt
>
> sed r /tmp/signature_temp.txt /tmp/fortune.txt >
> /root/final_signature.txt
>
> fortune > /etc/motd
> ----------------------------------------------------------------------
>
> The last bit sends an motd to each user that logs in...not really
> necessary, but cute...

Stephen - bash handles appending
thus
----------------------------------------
date > /tmp/fortune.txt
fortune >> /tmp/fortune.txt
uptime >> /tmp/fortune.txt

fortune > /etc/motd
----------------------------------------
should achieve the same thing.

By the way is motd a standard thing? If not how do you implement it?
Presumably it means "message of the day".

-- 
Michael

Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com

Reply via email to