Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #15576

Re: [FR] save command times and exit status in history automatically

From Ángel <angel@16bits.net>
Newsgroups gnu.bash.bug
Subject Re: [FR] save command times and exit status in history automatically
Date 2019-11-08 00:47 +0100
Message-ID <mailman.871.1573170474.13325.bug-bash@gnu.org> (permalink)
References <CAKOZuevfhS7veH9+GSc=8StpgrA_vy59Y2fYYGhMDk0OPZb69Q@mail.gmail.com> <8e19b0fc-4183-90fa-b067-9da636998d6f@case.edu> <CAKOZuevFuqrQhH75_-Dpum2VwmUkrP1r7E6b--v=Mg_EVHWuCw@mail.gmail.com> <1573170465.992.5.camel@16bits.net>

Show all headers | View raw


On 2019-11-07 at 12:18 -0800, Daniel Colascione wrote:
> Maybe what I
> really want is something like $?, but instead of containing exit
> status, it would contain information from a struct rusage (derived
> from wait4) for the last command. Or something like that anyway.

I would like having those variables, too. There was a related discussion
some time ago, and a workaround was mentioned (using PROMPT_COMMAND and
traps if I remember correctly), but I didn't like that approach too
much.

Would having such variables solve your needs? (using PROMPT_COMMAND to
copy them into a file, perhaps). I would expect that storing the values
from last wait4 would be much less intrusive than messing with history.


Kind regards

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Re: [FR] save command times and exit status in history automatically Ángel <angel@16bits.net> - 2019-11-08 00:47 +0100

csiph-web