Austin Group Defect Tracker

Aardvark Mark III


Viewing Issue Simple Details Jump to Notes ] Issue History ] Print ]
ID Category Severity Type Date Submitted Last Update
0001212 [1003.1(2016)/Issue7+TC2] Shell and Utilities Objection Enhancement Request 2018-09-28 02:56 2018-09-28 02:56
Reporter kre View Status public  
Assigned To
Priority normal Resolution Open  
Status New  
Name Robert Elz
Organization
User Reference
Section XCU 2.14 -- trap special builtin
Page Number 2420 - 2423
Line Number 77484-5 (and more)
Interp Status ---
Final Accepted Text
Summary 0001212: Enhance trap command
Description The trap command, as it stands, is missing two useful functions

1) the ability to discover the current action for a particular condition
2) the ability to save the current state of all conditions (see issue 1211)

Several shells have implemented a solution to (1) using a new -p option
to trap (unfortunately, the output format, and so how it should be used,
varies - but at least the mechanism is there).

The NetBSD shell has a solution to (2) based upon that for (1), but as
far as I know, no other shell has a solution to this, and the NetBSD shell
is not in widespread enough use to standardise its mechanism yet.

Hence, I am requesting that this issue be marked as "for the future" and
retained (along with any notes it attracts, and possible different solutions)
until we do have something that is ready to be included in the standard.

And implementers - please do *something*...

Also note, that for shells that have "trap -p" already, but treat it
used with no conditions as identical to "trap" with no operands, that
is not a useful feature (two ways to do the same thing) and changing the
implementation of "trap -p" as suggested below will do no harm.
Desired Action In the SYNOPSIS, between lines 77484 and 77485 add a new form for the command

      trap -p [condition...]

Then somewhere in the DESCRIPTION (probably after the paragraph about
trap with no operands, starting on line 77514) add a new paragraph

     When the -p option is given the trap command shall write,
     in the same format used when no operands are given, a list
     of commands for each condition specified as an operand, or if
     no operands, other than the -p flag, are given, then for all
     possible conditions for which actions can be set in the shell,
     whether currently at their default values,or not. It is unspecified
     whether the values for SIGKILL and SIGSTOP can be obtained this way,
     but if those are included in trap -p output, the shell shall not
     object to them used as input provided that the action specified
     is the same as was, or would be, output by trap -p, and in this case
     no undefined results shall occur.

Then change the example at line 77524 from
     save_traps=$(trap)
to
     save_traps=$(trap -p)
Tags No tags attached.
Attached Files

- Relationships

There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2018-09-28 02:56 kre New Issue
2018-09-28 02:56 kre Name => Robert Elz
2018-09-28 02:56 kre Section => XCU 2.14 -- trap special builtin
2018-09-28 02:56 kre Page Number => 2420 - 2423
2018-09-28 02:56 kre Line Number => 77484-5 (and more)


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker