Re: Odd shell behaviour
From: Mark R.Bannister (Chapter33_at_aol.com)
Date: 09/02/04
- Next message: Mark R.Bannister: "Re: bash: options not identical for set and shopt"
- Previous message: Ed Morton: "Re: Help for newbie, way to concatenate a set of files."
- In reply to: Alain G.: "Odd shell behaviour"
- Next in thread: Alain G.: "Re: Odd shell behaviour"
- Reply: Alain G.: "Re: Odd shell behaviour"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 2 Sep 2004 09:50:35 -0700
"Alain G." <agrumela@nospamfoxboro.ca> wrote in message news:<Ng9Zc.10204$7i2.610426@news20.bellglobal.com>...
> I have used the following shell sequence without any problems
> on a number of application running on Solaris 5.
>
> #! /bin/sh
>
> sleep 999 & pid=$!
> myprogr-syncpid $pid &
> wait $pid
>
> The idea is to suspend execution of the shell script until
> myprog has finished its initialization.
> myprog kills the sleep process using the $pid argument when
> it is ready and wait unblocks.
>
> I recently tried to use the same scheme on Solaris 8 and found
> it fails occasionally (not always).
> The shell does not suspend on wait and sleep lives on until the time
> expires.
> As far as I can tell, this fails because $! returns the pid of a sub-shell
> rather
> than the pid of the sleep process.
>
> The sh man pages says that the the shell will execute a command in a
> sub-shell
> if the command's executable file is not an a.out type of file.
> Yet when I check "which sleep" I find that it is /usr/bin/sleep and
> file /usr/bin/sleep reports that it is a regular executable file for that
> platform
> which I believe is the same as an a.out file.
>
> Is there anyone who can offer any explanation why this is happenning?
>
> Thanks
>
> AL.
I've tried a dozen
sleep 1 & pid=$! && wait $pid
on Solaris 8 and haven't experienced your problem. Can you email me a truss?
Regards,
Mark.
- Next message: Mark R.Bannister: "Re: bash: options not identical for set and shopt"
- Previous message: Ed Morton: "Re: Help for newbie, way to concatenate a set of files."
- In reply to: Alain G.: "Odd shell behaviour"
- Next in thread: Alain G.: "Re: Odd shell behaviour"
- Reply: Alain G.: "Re: Odd shell behaviour"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|