( adding bug-time@ )


On 2019-10-10 11:29 a.m., Сергей Кузнецов wrote:
By the way, I wrote two new small programs: xchg (or swap, which name is
better?) And exst (exit status).
[...] The second program launches the
program indicated at startup and, after its completion, prints the output
status or the caught signal.

Somewhat related:

the GNU Time program can report both exit code and signal
in the following way:

  $ env time -f "Exit code: %x\n" [SOME PROGRAM that dies with segfault]
  Command terminated by signal 11
  Exit code: 0

However, for a long time I wanted to add a new output format
specifier to GNU time that will indicate whether
a program existed cleaning or with a signal
(and which exit code or signal).

Your message reminded me of that, and I hope to add something
like that in the near future.

It could be something like:

   %T   1 if program terminated by a signal, empty otherwise
   %S   signal number of program terminal by a signal, empty otherwise
   %X   exit code if program terminated normal,
        or empty if terminated by a singal

And could be used like so:

  time -f "Signaled: %T (signal number: %S)\nExit code: %X\n" [PROGRAM]

Please send comments and suggestions to bug-t...@gnu.org .

 - assaf

Note that your built-in shell like has its own 'time' function.
To use GNU time run "env time" or "\time" .

Reply via email to