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

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



On Thu, Oct 12, 2006 at 08:51:29PM -0400, José Alburquerque wrote:
> 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. :-)
> 
If it is always the same commands, then consider setting them to use the
time command as an alias.

For example, if you always want to know how long a dd took, then use
something like `alias dd='/usr/bin/time /usr/bin/dd'`.

Of course, you will need to use dd and not /usr/bin/dd to get the
benefit.  Additionally, if you set your alias like this: `alias
dd='/usr/bin/time dd'`, then it will recurse and bad things will happen.
Trust me on this :-)

I once did `alias mutt='LANG= mutt'` and when I executed it, I had to
reboot the machine to get it to quit.

Regards,

-Roberto

-- 
Roberto C. Sanchez
http://people.connexer.com/~roberto
http://www.connexer.com

Attachment: signature.asc
Description: Digital signature


Reply to: