Odd shell behaviour
From: Alain G. (agrumela_at_nospamfoxboro.ca)
Date: 09/01/04
- Next message: Russ: "multi-character command-line options in bash"
- Previous message: Heiner Steven: "Re: (patch for Bash) x-y character plot"
- Next in thread: Mark R.Bannister: "Re: Odd shell behaviour"
- Reply: Mark R.Bannister: "Re: Odd shell behaviour"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 31 Aug 2004 21:07:32 -0400
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.
- Next message: Russ: "multi-character command-line options in bash"
- Previous message: Heiner Steven: "Re: (patch for Bash) x-y character plot"
- Next in thread: Mark R.Bannister: "Re: Odd shell behaviour"
- Reply: Mark R.Bannister: "Re: Odd shell behaviour"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|