[X-Unix] Login Hooks running items on login a little bit too
quickly
Juan Manuel Palacios
jmpalaciosp at eml.cc
Sat Jan 8 08:27:54 PST 2005
On Jan 7, 2005, at 7:16 PM, Our PAl Al wrote:
> I don't want to hard code a delay in my shell script since delay times
> until
> the Finder is up can vary by machine. Anybody know how a shell script
> could
> determine if the Finder is is fully up before proceeding to execute?
>
> - opa
$[juan at PowerBook: Pendulum](28/0,0)-> ps -ax | grep [F]inder
412 ?? S 0:16.91
/System/Library/CoreServices/Finder.app/Contents/MacOS/Finder
-psn_0_786433
$[juan at PowerBook: Pendulum](29/0,0)-> echo $?
0
$[juan at PowerBook: Pendulum](30/0,0)-> ps -ax | grep [F]ooooo
$[juan at PowerBook: Pendulum](31/0,0)-> echo $?
1
So I'd use:
ps -ax | grep [F]inder 2>&1 >/dev/null
if [ $(echo $?) == 0 ] ; then "proceed with your script ; fi
Hope that helps! Regards,...
Juan
More information about the X-Unix
mailing list