Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
job control problem
- X-seq: zsh-users 16841
- From: hanpingtian <hanpingtian@xxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: job control problem
- Date: Tue, 6 Mar 2012 18:01:38 +0800 (CST)
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=Received:Date:From:To:Message-ID:Subject: MIME-Version:Content-Type; bh=wxMe72PsaIRbjxDhAtA7Ys0C8Zrvx+97Cc YGTOcKp7c=; b=cfhaHz7pp1dDkR2/kb4cFXQODn7jXEpWR11pf6QmITl2FRo5L9 BkF0/Zm8pjxgki0H3m2l7rs6dfD9sDsZOItC7AdT/6Qxjzt4M0xwx0WV3OAKVaxV sP5d+QxxWTqzdSqV5AMvU96KWlAKCSwM1WT4NilpZvoT+ryUbVMpUYerA=
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
Hello,
I feel zsh's job control is a little weak than bash. For example, this script:
% cat t.sh
for ((i=1;i<=10000;i++))
do
sleep 1 &
done
wait
With zsh:
% zsh -x ./t.sh
...
./t.sh:3: fork failed: resource temporarily unavailable
+./t.sh:6> wait
+./t.sh:3> sleep 1
it will fail with the fork() failure very soon.
But with bash:
% bash -x ./t.sh
...
+ (( i++ ))
+ (( i<=10000 ))
./t.sh: fork: retry: Resource temporarily unavailable
+ sleep 1
+ sleep 1
+ sleep 1
+ sleep 1
+ sleep 1
+ sleep 1
+ sleep 1
+ sleep 1
./t.sh: fork: retry: Resource temporarily unavailable
+ (( i++ ))
...
It can run more longer by retry and retry.
And I noticed that when trying to run a lot of jobs in background can cause zsh quit or frozen.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author