2023年2月12日(日) 0:42 Robert Elz <k...@munnari.oz.au>:
> Why would you want to ever say "builtin jobs" though?
> The jobs command has to be buikt in to work.

`jobs' can be overwritten by a shell function. For example, when a
user wants to modify the behavior of `jobs' for interactive uses, a
typical solution is to override `jobs' with a shell function and call
`builtin jobs' in the overriding function.

I guessed you have asked this because `jobs' would be specified as a
special built-in utility [XCU 2.14], which cannot be hidden by a
shell-function name, but it doesn't seem to be the case actually;
`jobs' doesn't seem to be specified to be a special built-in utility.
Anyway, `jobs' can be hidden by a shell function at least in Bash.

I naively think that it is a valid request that `builtin jobs' would
behave in the same way as `jobs' in this context. POSIX also states
that the results are unspecified when the command name matches
`builtin' according to [XCU 2.9.1 / Command Search and Execution /
rule 1b].

--
Koichi

Reply via email to