PackageMaker PreFlight question

Joined
Aug 19, 2009
Messages
1
Reaction score
0
Points
1
Your Mac's Specs
imac 20'
Hello,

I have a very small script that I want to run as a pre-flight step in packagemaker.... its used to kill a specific process.


#!/bin/ksh
pid=`ps -e | egrep nameofmyapp | egrep -v egrep | awk '{print $1}`
kill -TERM ${pid}


When I do "Build and Run" it throws the message "Install Failed". By trial and error I've figured out that it does not like the kill line. Running the script standalone in a terminal works perfectly. Anyone have any ideas whats going on here, I'm puzzled.

Thanks,
Jonathan
 
Joined
Sep 18, 2009
Messages
2
Reaction score
0
Points
1
Location
India
Hi hello,

I am not sure but i think `ps -e | egrep nameofmyapp | egrep -v egrep | awk '{print $1}' won't return process id it will return user name so can you just try with pid=`ps -e | egrep nameofmyapp | egrep -v egrep | awk '{print $2}` instead of your particular command

Thanks you
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top