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

2006-10-16 Thread José Alburquerque
Aaron Hall wrote: On Sun, 15 Oct 2006, Jos� Alburquerque wrote: Matus UHLAR - fantomas wrote: tcsh has the feature of printing time automatically after each command executed (time variable). it also has 'precmd' and 'postcmd' aliases that are executed (if set) before and after any com

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

2006-10-15 Thread Aaron Hall
On Sun, 15 Oct 2006, Jos� Alburquerque wrote: > Matus UHLAR - fantomas wrote: > > > tcsh has the feature of printing time automatically after each > > command executed (time variable). it also has 'precmd' and 'postcmd' > > aliases that are executed (if set) before and after any command > > execut

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

2006-10-15 Thread José Alburquerque
Matus UHLAR - fantomas wrote: On 13.10.06 08:19, Ken Irving wrote: 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. tcsh has the feature of printing time automatically after each command execute

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

2006-10-15 Thread Matus UHLAR - fantomas
> 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, > > t

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

2006-10-13 Thread José Alburquerque
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

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

2006-10-13 Thread Scott Gifford
José Alburquerque <[EMAIL PROTECTED]> writes: > 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. If you're using bash, try something like this: PS1='@$SECONDS $ ' PS4='@

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

2006-10-13 Thread José Alburquerque
Dave Whiteley wrote: Looking at things differently... Can you not use the unix "time" command to display the process times on completion? Dave I take it you're referring to the same command already mentioned by Roberto and others. Right? -- Sincerely Jose Alburquerque -- To UNSUBSCRI

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

2006-10-13 Thread Ken Irving
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

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

2006-10-13 Thread Dave Whiteley
Looking at things differently... Can you not use the unix "time" command to display the process times on completion? Dave -- Dave Whiteley [EMAIL PROTECTED] Phone +44 (0)113 343 2059 Faculty of Engineering The University of Leeds. Leeds, LS2 9JT, UK -- To UNSUBSCRIBE, email to [EMAIL PROTE

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

2006-10-13 Thread José Alburquerque
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. Oops. Sorry about re-send. Just ignore this please. -- Sincerely Jose Alburquerque -- To UNSUBSCRIBE,

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

2006-10-13 Thread José Alburquerque
Matus UHLAR - fantomas wrote: you could try to insert the current date into your prompt (PS1) string, if you want it this way. also, looking at 'man bash', there's special variable: PROMPT_COMMAND If set, the value is executed as a command prior to issuing each primary prompt. If I

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

2006-10-13 Thread José Alburquerque
J.A. de Vries wrote: You could use PROMPT_COMMAND for this. I do to create a sort of statusbar in my shells (with the added help of tput). Found out about this last night using man. :-) I've copied the relevant parts of the code I wrote for that below. Just add it to your bashrc, adjust the

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

2006-10-13 Thread J.A. de Vries
On 2006-10-12 @ 19:10:33 (week 41) 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 t

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

2006-10-13 Thread Matus UHLAR - fantomas
On 12.10.06 19:10, 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. you could try to insert the current date into your prompt (PS1) string, if you want

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

2006-10-13 Thread Roberto C. Sanchez
On Thu, Oct 12, 2006 at 09:30:58PM -0700, Marc Shapiro wrote: > > I will agree that, if you only have a few commands that you regularly > want timed, then an alias is probably the easiest way to do it. > > I have the following alias: alias pr='pr -F -l 59', and it works just > fine, no recursio

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

2006-10-12 Thread Marc Shapiro
Roberto C. Sanchez wrote: 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

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

2006-10-12 Thread José Alburquerque
Roberto C. Sanchez wrote: 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 /us

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

2006-10-12 Thread Roberto C. Sanchez
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

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

2006-10-12 Thread José Alburquerque
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 se

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

2006-10-12 Thread Roberto C. Sanchez
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 displa