[EMAIL PROTECTED] wrote: > 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..
Does the vpnc need to be run in a terminal? Build up your script piece by piece. Run one command, such as the xterm -e su root blah blah blah (if you use sudo, you may be able to get away without needing to enter a password. Try something like the following in /etc/sudoers: cseberino ALL=NOPASSWD: /usr/local/bin/vpnc --udp qualcomm and replace su root with sudo. The sudoers(5) manpage has more information as to the format. Remember to use visudo(8) to do the actual editing) Once you have an invocation correct, put that into your script exactly as you typed it on the command line (this example comes from my scrpt that launches three xterms, one of which is a new mail monitor and the other two are mutt) aterm -name MuttXPsiduri -title 'Siduri Mail' -e ssh -t siduri mutt & aterm -name NewMailXP -title 'newmail (siduri)' -e ssh -t siduri watch -n 30 newmail If you want to ensure an order, don't let latter commands run until previous ones have. If you need the previous to complete successfully, wrap it in an if() block. Shell scripting is just like python programming, except the syntax is different and the command set is hghly restricted. As a bonus, the library that comes with shell scripting is every program located on the system. I hope that helps. -john -- [email protected] http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list
