Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: zsh behavior when fork() failed



On Thu, Mar 1, 2012 at 12:36 AM, Bart Schaefer
<schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Feb 29,  6:27pm, Dipak Gaigole wrote:
> }
> } I have applied this patch but unfortunately the script still continues
> } even after the fork failures while executing commands from the script.
> }
> } bash-2.05b$ cat /tmp/test1.sh
> } #!/bin/sh
> } x="My default value"
> } x=`date`
> } echo $?
> } echo "Current Date is:" "$x"
> } date
> } echo $?
> } bash-2.05b$ zsh /tmp/test1.sh
> } /tmp/test1.sh:3: fork failed: resource temporarily unavailable
> } 1
> } Current Date is: My default value
> } /tmp/test1.sh:6: fork failed: resource temporarily unavailable
> } 1
> } bash-2.05b$
> }
> } Can you please check this on your end?
>
> I get (schaefer[N] is my top-level prompt):
>
> schaefer[691] Src/zsh -f /tmp/test1.sh
> /tmp/test1.sh:3: fork failed: resource temporarily unavailable
> 1
> Current Date is: My default value
> /tmp/test1.sh:6: fork failed: resource temporarily unavailable
> schaefer[692] echo $?
> 1
>
> There's no exit after `date` because that was in a subshell, but I do
> see the exit after the command in the parent shell.
>
> Are you sure a path-searched "zsh" is finding the right binary?

Sorry my bad :(  I had missed one of the fatal condition.

Thanks for your help Bart !!!

-Dipak



Messages sorted by: Reverse Date, Date, Thread, Author