On Mon, Mar 04, 2002 at 10:52:15AM -0800, Steven Augart wrote:
I'd never done this before, but couldn't resist. I wrote a little shell script (attached) that works if you use any email client that reads the file ~/.signature.
You need to just run the following shell-script. It creates a named pipe named ~/.signature. It then repeatedly writes the information to the named pipe. It blocks and waits if nobody is available to read from that named pipe.
--Steve Augart
In the spirit of open source, here is an update to your script. I ran into a problem after killing your script (with Ctrl-C) -- the fifo was left open but no one was writing to it so it caused my mail program (mutt) to hang. The update ensues that the fifo is removed when the script ends. See the section with the comment "# Be sure pipe is deleted upon exit." =============== cut ==================================== ## Dynamic .signature ## written by Steve Augart <steve at users dot sourceforge dot net> ## 3/4/2002: exit handler by Robert Paulsen ## ## Set up the FIFO if it doesn't exist, and perform some sanity checks. fifo=~/.signature if [ -e $fifo ] && [ ! -p $fifo ]; then >&2 echo "$fifo already exists, and isn't a named pipe. Giving up." exit 1; elif [ ! -e $fifo ]; then mkfifo $fifo || { >&2 echo "Couldn't create a named pipe named $fifo"; exit 1; } elif [ ! -w $fifo ]; then >&2 echo "Cannot write to $fifo; giving up!" exit 1; fi # Be sure pipe is deleted upon exit. function exit_handler() { [ -p $fifo ] && rm $fifo } trap "exit_handler" 0 # 0 is exit signal set -e # exit in case of error. while :; do { echo "This is a sample dynamic .signature"; uptime; } > $fifo sleep 1 done =============== cut ====================================
-- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/support/faq and the archives at http://lists.suse.com