Subject: Re: making a job current
To: None <joe@laffeycomputer.com>
From: charlie an <charlie@tradeit.com>
List: port-mac68k
Date: 11/16/1998 15:02:51
If you're in the same tty, you can use:

#!/bin/sh

pid=`ps -aux | grep pine | awk '{print $2}'`
if [ -n "$pid" ] ; then
	fg $pid
fi

If you're in a different tty, you can put this into .twmrc (assuming you're in twm)

Menu defop
{
	....
	...
	"Pine" f.warpto "Pine"
}

and set "Pine" in AutoRaise

Make sure you'll invoke pine with "xterm -n Pine -e pine &" in the first place.

You may also take advange of the f.exec facility to check if the pine is already running...

Charlie

Joe Laffey wrote:
> 
> I use pine for e-mail and if you start a second instance of pine it is
> VERY slow to open as it tries to get the mailbox lock and inevitably
> fails. Thus, I was write a little perl script to see if pine was already
> running. I'd really like this script to bring pine to the foreground if it
> is already running. However, I don't know how to bring a job to the
> foreground. If I use the exec or system commands this seems to invoke
> _another_ shell which has no concept of the jobs in the original shell. Is
> there a way to bring a job to the foreground by pid?
> 
> Thanks,
> 
> Joe Laffey
> LAFFEY Computer Imaging
> St. Louis, MO
> http://www.laffeycomputer.com
> -----------------------------