zsh-users
 help / color / mirror / code / Atom feed
* weird zsh problem with background procs and scripts
@ 2006-08-12 22:35 Tyler Spivey
  2006-08-13 21:45 ` Anssi Saari
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Tyler Spivey @ 2006-08-12 22:35 UTC (permalink / raw)
  To: zsh-users

If you put the following into a loop it won't work. Is there a
workaround?

#!/bin/zsh
while :;do
ed &
jobs
sleep 1
done

this should launch a bunch of eds int he background, but only seems to
load one.
zsh -x shows that it's not even taking the &.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: weird zsh problem with background procs and scripts
  2006-08-12 22:35 weird zsh problem with background procs and scripts Tyler Spivey
@ 2006-08-13 21:45 ` Anssi Saari
  2006-08-13 21:53 ` Bart Schaefer
  2006-08-14  2:39 ` Geoff Wing
  2 siblings, 0 replies; 4+ messages in thread
From: Anssi Saari @ 2006-08-13 21:45 UTC (permalink / raw)
  To: zsh-users

On Sat, Aug 12, 2006 at 03:35:15PM -0700, Tyler Spivey wrote:
> If you put the following into a loop it won't work. Is there a
> workaround?
> 
> #!/bin/zsh
> while :;do
> ed &
> jobs
> sleep 1
> done
> 
> this should launch a bunch of eds int he background, but only seems to
> load one.
> zsh -x shows that it's not even taking the &.

Do you really want to launch a bunch of eds or is there something else
you're trying to accomplish? Ed happens to quit immediately when started
like that, so the script doesn't do much. You can for example start a
bunch of sleeps with that.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: weird zsh problem with background procs and scripts
  2006-08-12 22:35 weird zsh problem with background procs and scripts Tyler Spivey
  2006-08-13 21:45 ` Anssi Saari
@ 2006-08-13 21:53 ` Bart Schaefer
  2006-08-14  2:39 ` Geoff Wing
  2 siblings, 0 replies; 4+ messages in thread
From: Bart Schaefer @ 2006-08-13 21:53 UTC (permalink / raw)
  To: zsh-users

On Aug 12,  3:35pm, Tyler Spivey wrote:
}
} If you put the following into a loop it won't work. Is there a
} workaround?

What exactly do you expect to happen when you run "ed" in the background?
As far as I can tell it simply exits immediately, which would explain why
you only have one of them running at a time.

} zsh -x shows that it's not even taking the &.

You are misled.  "zsh -x" does not print the "&" because it doesn't print
*any* command separators.  Compare with:

#! /bin/zsh -f
while :;do
sleep 5 & sleep 6 &
jobs
sleep 1
done


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: weird zsh problem with background procs and scripts
  2006-08-12 22:35 weird zsh problem with background procs and scripts Tyler Spivey
  2006-08-13 21:45 ` Anssi Saari
  2006-08-13 21:53 ` Bart Schaefer
@ 2006-08-14  2:39 ` Geoff Wing
  2 siblings, 0 replies; 4+ messages in thread
From: Geoff Wing @ 2006-08-14  2:39 UTC (permalink / raw)
  To: zsh-users

On Sunday 2006-08-13 08:34 +1000, Tyler Spivey output:
:If you put the following into a loop it won't work. Is there a
:workaround?
:#!/bin/zsh
:while :;do
:ed &
:jobs
:sleep 1
:done
:this should launch a bunch of eds int he background, but only seems to
:load one.

Works for me.  4.3.2-dev-1 on NetBSD.
Maybe your ed is exiting instead?

[3] 3050
[3]  + suspended (tty input)  ed
[3]  + suspended (tty input)  ed
[4] 8521
[4]  + suspended (tty input)  ed
[3]  - suspended (tty input)  ed
[4]  + suspended (tty input)  ed
[5] 29234
[5]  + suspended (tty input)  ed
[3]    suspended (tty input)  ed
[4]  - suspended (tty input)  ed
[5]  + suspended (tty input)  ed
...
and so on.

Regards,
Geoff


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-08-14  2:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-12 22:35 weird zsh problem with background procs and scripts Tyler Spivey
2006-08-13 21:45 ` Anssi Saari
2006-08-13 21:53 ` Bart Schaefer
2006-08-14  2:39 ` Geoff Wing

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).