--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
DESCRIPTION Killall kills processes selected by name, as opposed to the selection by pid as done by kill(1). By default, it will send a TERM signal to all processes with a real UID identical to the caller of killall that match the name procname. The super-user is allowed to kill any process.
Just a thought, from somebody who ifrst discovered killall on the Apple OS X Server list when Mike Bartosh deconstructed my own elaborate construct that got replaced by killall lookupd. :^)
But don't try that command on a system that looks more like System V if you are root:
# man killall Reformatting page. Please Wait... done
System Administration Commands killall(1M)
NAME
killall - kill all active processesSYNOPSIS
/usr/sbin/killall [signal]DESCRIPTION
killall is used by shutdown(1M) to kill all active processes
not directly related to the shutdown procedure. killall terminates all processes with open files so that the
mounted file systems will be unbusied and can be unmounted. killall sends signal (see kill(1)) to the active processes.
If no signal is specified, a default of 15 is used.The killall command can be run only by the super-user.
ATTRIBUTES
See attributes(5) for descriptions of the following attri-
butes: ____________________________________________________________
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
|_____________________________|_____________________________|
| Availability | SUNWcsu |
|_____________________________|_____________________________|SEE ALSO
kill(1), ps(1), fuser(1M), shutdown(1M), signal(3C), attri-
butes(5)SunOS 5.9 Last change: 14 Sep 1992 1
-- Bill Cole [EMAIL PROTECTED]
############################################################# 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]>
