From: ZyX <zyx.vim@gmail.com>
To: zsh-workers@zsh.org
Subject: Re: `jobs' builtin does not work with pipe in scripts
Date: Fri, 26 Nov 2010 21:16:14 +0300 [thread overview]
Message-ID: <201011262116.15270@-zyx> (raw)
In-Reply-To: <101126094739.ZM25971@torch.brasslantern.com>
[-- Attachment #1: Type: Text/Plain, Size: 1216 bytes --]
Reply to message «Re: `jobs' builtin does not work with pipe in scripts»,
sent 20:47:39 26 November 2010, Friday
by Bart Schaefer:
What is your version of zsh? It does not work for me:
(zyx:~) % zsh -fc 'sleep 3 & fg'
zsh:fg:1: no job control in this shell.
(zyx:~) % zsh -omonitor -fc 'sleep 3 & fg'
zsh:fg:1: no job control in this shell.
(zyx:~) % zsh -fc 'setopt monitor;sleep 3 & fg'
zsh:setopt:1: can't change option: monitor
zsh:fg:1: no job control in this shell.
And if zsh does not provide job control without this option, why `jobs' works as
expected without pipe?
Original message:
> On Nov 26, 7:38am, ZyX wrote:
> }
> } What more? `jobs -p | ...' is not working
>
> If you want "jobs" to do something reliable, you have to set the
> MONITOR option. Zsh by default does not provide job control in a
> non-interactive shell.
>
> % zsh -fc 'sleep 3 & fg'
> zsh:fg:1: no job control in this shell.
> % zsh -fc 'setopt monitor; sleep 3 & fg'
> [1] 25945
> [1] + running sleep 3
> % zsh -fc 'sleep 3 & jobs -p | sed s/run/RUN/'
> % zsh -o monitor -fc 'sleep 3 & jobs -p | s/run/RUN/'
> [1] 25967
> [1] + 25967 RUNning sleep 3
> %
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
next prev parent reply other threads:[~2010-11-26 18:16 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-25 20:41 ZyX
2010-11-25 20:57 ` Marc Weber
2010-11-25 21:40 ` ZyX
2010-11-25 23:56 ` Marc Weber
2010-11-26 4:38 ` ZyX
2010-11-26 17:47 ` Bart Schaefer
2010-11-26 18:16 ` ZyX [this message]
2010-11-28 1:37 ` Bart Schaefer
2010-11-28 3:26 ` ZyX
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201011262116.15270@-zyx \
--to=zyx.vim@gmail.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).