[X-Unix] SED help

Charles Howse chowse at charter.net
Thu Nov 3 10:02:29 PST 2005


> Any suggestions would be greatly appreciated.

This kind of stuff is fun for me, here's something I whipped up...
____________
#!/bin/bash

printf  "I will add \"$1\" to the files, continue? [y/n]: "
read a

case $a in
    Y|y)
        #command to execute goes here
        ;;
    *)
        exit 0
esac
___________

The first line tells the script to use bash, even though your default shell
is something else.
The printf line echoes the email address you entered as a parameter, i.e.
$ addname.sh me at privacy.net
Would give you
$ I will add "me at privacy.net" to the files, continue? [y/n]:
You would then press "Y" or "y" to run the script, or anything else to exit.
Simple.  ;-)
We would still have to come up with something to list all the mailto files,
but that doesn't present too much of a challenge.  Maybe you could let me
know the way they are organized...all subdirectories of a single directory,
maybe?




More information about the X-Unix mailing list