Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!news.cs.indiana.edu!sahayman@iuvax.cs.indiana.edu From: sahayman@iuvax.cs.indiana.edu (Steve Hayman) Newsgroups: comp.unix.questions Subject: Re: setting Sign in /usr/ucb/mail Message-ID: <1991Feb14.020848.25671@news.cs.indiana.edu> Date: 14 Feb 91 07:08:29 GMT References: <1991Feb6.185423.16803@elroy.jpl.nasa.gov> <3380@unisoft.UUCP> Organization: Computer Science Department, Indiana University Lines: 55 Here is a trick for including a .signature with stock BSD mail, which doesn't have a "sign" variable or anything like that. Recall that when composing a message, ~v and ~e both invoke editors on the message. If you were so inclined you could arrange to use a different editor program with each of ~v and ~e, by doing this in the .mailrc set VISUAL=/usr/ucb/vi set EDITOR=/usr/local/bin/emacs which would invoke vi when you used ~v, and emacs when you use ~e. Now there is really no reason why both of these programs have to be actual text editors. One could be a program that adds a .signature. That's what I do - I use ~v to edit messages (with vi) and ~e to add a .signature. I have this in my .mailrc set VISUAL=/usr/ucb/vi set EDITOR=/u/sahayman/bin/addsig where "addsig" is a little program that just appends a .signature file to the file it's given on the command line. This is the "addsig" script, which will add a .signature to a mail message when you type ~e . I use it all the time. Works great. #!/bin/sh # addsig - hack that adds a signature to $1 # Useful within mail, do a "set EDITOR=/u/sahayman/bin/addsig" in the .mailrc # and then "~e" becomes a command which adds a signature to a message. # You can still use ~v to edit mail, since it uses VISUAL # # Steve Hayman # sahayman@cs.indiana.edu # I don't want mine included by default by anything, so I call it ".sig" signature=${HOME}/.sig if [ ! -f $signature ]; then echo "${0}: No signature file $signature" 1>&2 exit 1 fi case $# in 0) # add to stdin, useful as a vi filter cat echo "-- " cat $signature ;; *) (echo "-- "; cat $signature) >>$1 ;; esac