[X-Unix] Login Hooks running items on login a little bit too quickly

Brian Medley bpm-list-osx-unix at 4321.tv
Mon Jan 10 08:06:11 PST 2005


On Mon, Jan 10, 2005 at 09:36:01AM -0500, Our PAl Al wrote:

> Don't quite fully understand it  but I think I can still use it.
> 
> Why do you have the [] around the F in Finder? When I use that line, it
> doesn't work.  ps -ax | grep Finder  (without the [] ) works fine.

Some shells require the [] to be quoted.  

However, to answer your question, I believe the [] is used to
emulate this:

    $ ps -ax | grep prog | grep -v grep

The reason it works is because 'grep [p]rog' is actually
searching for 'prog', but the grep command shows up with the
brackets in ps.

> On 1/8/05 11:27 AM, "Juan Manuel Palacios" <jmpalaciosp at eml.cc> wrote:
> 
> > 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?
> > 
> > $[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,...

-- 
~`^`'~=-._.-=~'`^`'~=-._.-=~'^'~=-., \|/  (___)  \|/ _,.-=~'`^`
                                      @~./'O o`\.~@
      "Knowledge is Power"           /__( \___/ )__\  *PPPFFBT!*
         -- Francis Bacon               `\__`U_/'
 _.-=~'``'~=-._.-=~'``'~=-._.-=~'`^`'~= <____|'  ^^`'~=-.,__,.-=
~'^`'~=-._.-=~'`^`'~=-._.-=~'^'~=-.,__,.-==--^'~=-.,__,.-=~'`^`


More information about the X-Unix mailing list