--do shell script "/bin/ps -xa" do shell script "pid=` /bin/ps -x | /usr/bin/grep \"Classic Startup.ap[p]\" | /usr/bin/awk '{print $1}'` ; kill $pid"
no sense messing with all that.
do shell script "kill `/bin/ps x| /usr/bin/grep \"Classic Startup\" | grep -v grep | /usr/bin/awk '{print $1}'`"
(first, the - is deprecated for ps, second, you need to exclude the grep because it MIGHT have a lower PID that the Classic Startup, third no reason to mess with storing off to variables when you can do it all in a single command.)
No sense messing around with all THAT, either.
man killall
I've never gotten killall to work with a GUI app. It's fine for apps that show up in the list as their name, like lookupd or named or something, but for example,
killall Dock.app
does nothing
I'm sure I'm missing something silly, but I've had very good luck with the grep/awk above (and once it's written once it need never be written again, right?)
Also, there is the portability issue. The grep/awk will work as expected on any system (for example, I use it on my FreeBSD system to kill off backgrounded BitchX sessions) while killall will not.
--
Heisenberg's only uncertainty was what pub to vomit in next and Jung fancied Freud's mother too. -- Jared Earle
############################################################# This message is sent to you because you are subscribed to the mailing list <[EMAIL PROTECTED]>. To unsubscribe, E-mail to: <[EMAIL PROTECTED]> To switch to the DIGEST mode, E-mail to <[EMAIL PROTECTED]> To switch to the INDEX mode, E-mail to <[EMAIL PROTECTED]> Send administrative queries to <[EMAIL PROTECTED]>
