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

Re: suspend (^Z) behavior while a function is running is unclear



On 20 February 2012 19:53, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Feb 20,  7:33pm, Vincent Lefevre wrote:
> } Subject: Re: suspend (^Z) behavior while a function is running is unclear
> }
> } > torch% foreach foo (a b c) { sleep 5 } | :
> } > zsh: job can't be suspended
> }
> } However if the command outputs something, one loses the output.
>
> I didn't really mean to imply that you should use this, just that some
> of the plumbing is in place if we wanted to provide direct control.
>
> On the other hand:
>
> foreach foo (a b c) { print $foo; sleep 5 } | while { read -rE } { : }
>
> (Using shortloops syntax to emphasize zsh-ness of this trick.)

(This is actually not shortloops syntax.)

-- 
Mikael Magnusson



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