Re: [SLUG] "set -x" with timestamps? (fwd)

From: Eben King (eben01@verizon.net)
Date: Sat Mar 29 2008 - 17:13:51 EST


from Wayne Pollock. Thanks, great idea.

---------- Forwarded message ----------
Date: Sat, 29 Mar 2008 18:02:09 -0400
From: Wayne Pollock <wpollock@hccfl.edu>
To: eben01@verizon.net
Subject: Re: [SLUG] "set -x" with timestamps?

Forget the previous emails. Change your PS4 prompt
from the default of a '+' to the date, and turn on
set -x.

Sheesh! This was much easier than I thought, I'm
embarrassed with the convoluted solutions I gave you
previously.

==============================
#!/bin/bash -
set -x
PS4='\D{%b %e %H:%M:%S }'
... # rest of script
==============================

This works in zsh as well, and in a different
way in ksh (use command substitution with
the date command).

-Wayne
-----------------------------------------------------------------------
This list is provided as an unmoderated internet service by Networked
Knowledge Systems (NKS). Views and opinions expressed in messages
posted are those of the author and do not necessarily reflect the
official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 15:28:46 EDT