[comp.unix.wizards] emacs or fg %emacs

mrd@sun.mcs.clarkson.EDU (12/08/87)

Someone asked for a little alias the would either fireup emacs or
bring it to the foreground.  Well I came up with this.  I am sure
there is a more elegant and shorter way to do it but it does do it, at
least on Sun OS 3.4.

alias gnu 		'eval `ps | egrep "([ ][e]macs|[ ][C]OMMAND)" | sed "s/.*emacs.*/fg %emacs/" | sed "s/.*COMMAND.*/emacs/" | tail -1`'

It does force you to use gnu instead of emacs the way I have it here
but you can if necessary modify it so that you can call it emacs, it
is just more complicated.


Michael DeCorte
mrd@clutx.clarkson.edu
mrd@clutx.bitnet