[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Printing the date just before execution of commands in bash



Scott Gifford wrote:
If you're using bash, try something like this:

    PS1='@$SECONDS $ '
    PS4='@$SECONDS: '
    set -x

That will show you the number of seconds since the shell started up in
your prompt, and before running each command.  Plain seconds are nice
and easy to subtract; if you'd prefer a different format, see the
PROMPTING section of the bash(1) manpage.

----Scott.


Really nice. Never would have thought to use debugging this way. I think this one gets closest to what I've been trying to do. Thanks very much.

--
Sincerely
Jose Alburquerque



Reply to: