1 # From: Seth Chaiklin <psykseth@aau.dk>
2 # To: chet@ins.CWRU.Edu
3 # Subject: bash functions (sorta)
8 # declare the a program should be "kept". i.e. try to fg a stopped one
9 # and only when that fails start a fresh program.
16 *) echo "usage: keep [alias] program" 1>&2 ; return 1;;
22 # set up an alias for the kept program
24 alias "$pn=fg $1 2>/dev/null || $1"
26 alias "$1=fg $2 2>/dev/null || $2"
32 # usage: unkeep program
33 # unset the alias set up by the keep function
39 echo "usage: unkeep program"
43 # unset the alias for the kept program
49 # lists all kept programs in 'alias: program' form
54 alias | grep "fg.*2>" | sed "s/alias \(.*\)='fg.*||\(.*\)'$/\1:\2/"
58 # some things that should be kept
59 #keep /usr/local/bin/emacs
60 #keep e ${EDITOR:-/usr/local/bin/emacs}
61 #keep edit ${EDITOR:-/usr/local/bin/emacs}
62 #keep /usr/local/bin/emm