Re: Printing the date just before execution of commands in bash
On Fri, Oct 13, 2006 at 11:32:03AM -0400, José Alburquerque wrote:
> However, I do admit that using time for commands is probably a lot
> better. Besides, I can never get a "precise" time with just inserting
> the date in the prompt because if the terminal sits idle for some time,
> the time in which a command starts executing can not be correctly
> determined this way because you never really know how much time went by
> (by just looking at the prompt) before the command started execution.
>
> Wouldn't it be nice if bash would allow a "secondary" definable "prompt"
> that would be issued just *before* command execution? Then stuff like
> printing date before commands could be done. Just a wish. :-) But
> thanks for input.
The -t option to script gives precise timing of output to the terminal,
and could be post-processed to yield the timing you're looking for.
Ken
--
Ken Irving, fnkci@uaf.edu
Reply to: