bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "builtin jobs" does not output to stdout.


From: Robert Elz
Subject: Re: "builtin jobs" does not output to stdout.
Date: Sat, 11 Feb 2023 22:32:38 +0700

    Date:        Sat, 11 Feb 2023 22:54:47 +0900
    From:        =?UTF-8?B?5bKh6YOo5bCG5bm4?= <okabe_m@hmi.aitech.ac.jp>
    Message-ID:  
<CADE-OTFYU3av0YAn=XTa4hUx53SC8Ss_HE9JQ7b4fB=xTN+EFw@mail.gmail.com>

  | "jobs" outputs to stdout, but "builtin jobs" does not
  | output to stdout.

Your test is flawed.   Processes in a pipeline are in a
subshell environment.  That environment has no jobs, hence
no output.

But there is a special exemption for that, when 'jobs'
is the first command in the subshell.  Then it reports
its parent's jobs table instead (this is to allow
j=$(jobs) to work mainly).

So jobs|whatever produces output, but builtin jobs|... does not.

To test whether builtin jobs writes to stdout, use

        builtin jobs >/tmp/foo

instead.   No subshell there, so it should work.


Why would you want to ever say "builtin jobs" though?
The jobs command has to be buikt in to work.

kre




reply via email to

[Prev in Thread] Current Thread [Next in Thread]