begin quoting [EMAIL PROTECTED] as of Mon, Nov 19, 2007 at 05:33:02PM -0800:
> On Mon, Nov 19, 2007 at 04:47:31PM -0800, [EMAIL PROTECTED] wrote:
> > Yes that worked. Now for something a little harder.... what if one of the
> > commends on the list was trying to execute mutt on a remote machine?
>
> ok i got that one: ssh -t server mutt
>
> Here is an even harder one...suppose you wanted SOME things to be run in
> background in parallel and other things to wait on other things....
>
> e.g. I can't start certain things before the VPN is set up..
>
> #!/bin/sh
>
> xterm -e su root "vpnc --udp qualcomm" ; \
> "xterm -e ssh -t [EMAIL PROTECTED] mutt &" ; \
> "xterm -e changetitle LAB_TUNNEL ; \
> ssh -L $PORT:$LAB_PC:5900 $PROXY_PC &" ;
> "gaim &" ;
> sleep 4 &
sleep in the background?
> xterm -e ssh -t server mutt &
>
> Everything in the 1st xterm command is meant to be run after i set up vpn with
> the vpnc app. It doesn't work. I think all those ampersands are confusing
> it.
I think it's the quotes.
I'm a bit bemused as to why you're using ; in a script instead of
putting each command on its own line.
Nevertheless, when you run
"xterm -e ssh -t [EMAIL PROTECTED] mutt &" ; \
...it's trying to run a command with spaces in the name.
I suspect this is not what you intend.
Try (untested):
-----------------------------------------------------------------------------
#!/bin/sh
#
# Set up the VPN and run a bunch of stuff
#
xterm -e su root "vpnc --udp qualcomm"
xterm -e ssh -t [EMAIL PROTECTED] mutt &
xterm -e sh -c "changetitle LAB_TUNNEL ; ssh -L $PORT:$LAB_PC:5900 $PROXY_PC" &
gaim &
sleep 4
xterm -e ssh -t server mutt &
-----------------------------------------------------------------------------
--
Remember, & is for running things in the background, && for dependencies.
Stewart Stremler
--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list