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

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

Roberto C. Sanchez wrote:
On Thu, Oct 12, 2006 at 07:10:57PM -0400, José Alburquerque wrote:
Hi all.  I'm wondering if anyone knows how I might be able to execute
the same command just before the execution of a command issued at the
prompt of a bash shell.

Currently, I have my bash prompt set up so that it displays the current
date.  If I can print the date just before each command is executed, I
can always be able to get a sense of how long each command has taken.

Anyone has any idea how I might go about printing the date just before
the execution of each bash command?  I just don't know where I would
start.  Thanks for any help.

Why not just use /usr/bin/time for the commands which you you want to



I guess I could do that, it's just that I use certain commands almost "instinctively" and sometimes I forget. A lot of times I'm running certain processes one after the other in several shells. It is after I've run them that I realize that it would have been nice to "time" some of them.

I suppose I could just be more attentive as to which commands I'd like to "time". I'll keep what you say in mind. :-)

Jose Alburquerque

Reply to: