https://bugs.dragonflybsd.org/https://bugs.dragonflybsd.org/favicon.ico?16293952082022-05-13T12:57:27ZDragonFlyBSD bugtrackerDragonFlyBSD - Bug #1397: jobs -l output inconsistency when called from scripthttps://bugs.dragonflybsd.org/issues/1397?journal_id=142552022-05-13T12:57:27Ztuxillo
<ul><li><strong>Description</strong> updated (<a title="View differences" href="/journals/14255/diff?detail_id=3804">diff</a>)</li><li><strong>Assignee</strong> deleted (<del><i>0</i></del>)</li></ul> DragonFlyBSD - Bug #1397: jobs -l output inconsistency when called from scripthttps://bugs.dragonflybsd.org/issues/1397?journal_id=142572022-05-15T12:07:47Ztuxillo
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Feedback</i></li><li><strong>Assignee</strong> set to <i>tuxillo</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>90</i></li></ul><p>The <code>jobs(1)</code> utility calls whatever builtin the current shell uses, or it is directly bypassed by the shell itself, example:</p>
<pre>
$ cat /usr/bin/jobs
#!/bin/sh
# $FreeBSD: src/usr.bin/alias/generic.sh,v 1.2 2005/10/24 22:32:19 cperciva Exp $
# $DragonFly: src/usr.bin/alias/generic.sh,v 1.3 2007/08/05 16:09:50 pavalos Exp $
# This file is in the public domain.
builtin ${0##*/} ${1+"$@"}
</pre>
<p>And in every shell:</p>
<pre>
$ tcsh
$ which jobs
jobs: shell built-in command.
$ sh
$ which jobs
/usr/bin/jobs
$ bash
$ which jobs
/usr/bin/jobs
</pre>
<p>Now if you run the testjobs.sh in different shells, you might get different results, bash and sh behaving the same way:</p>
<pre>
$ sh testjobs.sh
[1] + 814254 Running
$ csh testjobs.sh
[1] 814260
[1] + 814260 Running sleep 30
</pre>
<p>Even in Solaris there is a <code><command unknown></code> with the job listing, so I'd rather have not output at all.</p>
<p>If further comments are needed, let us know, otherwise we will close this issue.</p>