bash timestamp
Sep. 6th, 2007 11:36 amIs there a way to make my shell show the date&time every time I get the prompt?
This would make it easy to measure how long things took, even before you suspect anything.
This would make it easy to measure how long things took, even before you suspect anything.
(no subject)
Date: 2007-09-06 04:11 pm (UTC)PS1="\D{%d-%m-%y--%H-%M-%S} $ "
(no subject)
Date: 2007-09-06 04:12 pm (UTC)PS1="\D{%d-%m-%y--%H:%M:%S} $ "
But then, the dashes and colons are all replaceable with whatever you like.
(no subject)
Date: 2007-09-06 04:51 pm (UTC)(no subject)
Date: 2007-09-06 04:54 pm (UTC)resulting in: bash(06-09-07, 12:53:51) $
(no subject)
Date: 2007-09-06 06:28 pm (UTC)I suppose I can always add a line like "echo", but that's not exactly the same thing.
(no subject)
Date: 2007-09-06 07:22 pm (UTC)(no subject)
Date: 2007-09-06 07:43 pm (UTC)OTOH, it's better to not have to add anything to your scripts.
(no subject)
Date: 2007-09-07 12:46 am (UTC)(no subject)
Date: 2007-09-07 01:26 am (UTC)In any case, I'm worrying that "echo" will not give you a prompt inside of the script... You only get one when the script to actually finishes...
(no subject)
Date: 2007-09-07 02:19 am (UTC)(no subject)
Date: 2007-09-07 04:42 pm (UTC)(no subject)
Date: 2007-09-06 04:12 pm (UTC)