standards/99926: [Patch] [sh(1)'s jobs] POSIX compliancy by adding -p switch

Ed Schouten ed at
Sat Jul 8 20:30:22 UTC 2006

>Number:         99926
>Category:       standards
>Synopsis:       [Patch] [sh(1)'s jobs] POSIX compliancy by adding -p switch
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-standards
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jul 08 20:30:18 GMT 2006
>Originator:     Ed Schouten
>Release:        FreeBSD 7.0-CURRENT i386
System: FreeBSD 7.0-CURRENT FreeBSD 7.0-CURRENT #0: Sun Jul 2 10:55:26 CEST 2006 root at i386
According to the POSIX 2001 standard, the jobs command in sh(1) should
implement a -p switch that displays output similar to FreeBSD's -s
switch, but only shows PIDs for process group leaders. It isn't
available, however.

Run the following commands in sh(1);

$ sleep 10 | cat &
$ jobs -p

The latter command will fail, because the built-in jobs command does not
support the -p switch.

Apply the patch located at:

This patch adds an argument 'pformat' the showjob() and showjobs()
functions. When set, its output format is the same as when 'sformat' is
set, but limited to process group leaders only.

The sh(1) manual page has also been updated to reflect the changes.

Please note that this patch marks the 'Add missing components to the
jobs utility.' task of the C99 project as completed.

More information about the freebsd-standards mailing list