Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Jul 1997 19:55:03 -0700
From:      Justin Ashworth <ashworth@spacehog.structured.net>
To:        questions@freebsd.org
Subject:   Fortune .sigs - answered
Message-ID:  <33C6F207.9BBA683C@spacehog.structured.net>

next in thread | raw e-mail | index | archive | help
I posted a question a while back about how to put a quote from fortune
in a signature file. I came up with a solution to my own question a
while back and would like to share it for those who may be interested. I
wrote a shell script that runs by a cron process every hour. It's
something that I'm sure a lot of you can hack up in a matter of minutes,
but I'm putting it here for the people who can't. Here's the script
(change_sig):

-------------------------------
#!/bin/sh

#############################################
#                                           #
#       Fortune Signature Generator         #
#           by Justin Ashworth              #
#                                           #
#############################################

# Change this to your home directory
HOMEDIR=/home/justin

# .signature.start contains the portion of your signature
# that you always want at the top. File can be nonexistent.

if [ -s $HOMEDIR/.signature.start ]
then
  cp $HOMEDIR/.signature.start $HOMEDIR/.signature
fi

exec `/usr/games/fortune -s /usr/share/games/fortune/fortunes \
/usr/share/games/fortune/fortunes2 /usr/share/games/fortune/zippy \
 >> $HOMEDIR/.signature`

# .signature.end contains the portion of your signature
# that you always want at the bottom. File can be nonexistent.

if [ -s $HOMEDIR/.signature.end ]
then
  cat $HOMEDIR/.signature.end >> $HOMEDIR/.signature
fi

# This is to avoid Netscape Mail's signature length
# warning. It sets the file date back so that it
# looks like it wasn't modified.

touch -t 9706072000 $HOMEDIR/.signature
-------------------------------

The crontab entry: 0 * * * * /home/justin/bin/change_sig

-------------------------------

Let me know if you like it.

-- 
----------------------------------------------------------------
Justin Ashworth, Intern               Structured Network Systems
justin@structured.net                 http://www.structured.net
----------------------------------------------------------------
Question: Is it better to abide by the rules until
they're changed or help speed the change by breaking them?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?33C6F207.9BBA683C>