From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4910 invoked from network); 15 Apr 2001 19:50:12 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 15 Apr 2001 19:50:12 -0000 Received: (qmail 11343 invoked by alias); 15 Apr 2001 19:50:06 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 3820 Received: (qmail 11327 invoked from network); 15 Apr 2001 19:50:05 -0000 From: "Bart Schaefer" Message-Id: <1010415194943.ZM11223@candle.brasslantern.com> Date: Sun, 15 Apr 2001 19:49:43 +0000 In-Reply-To: <15065.17386.300246.739496@paullew-ultra.cisco.com> Comments: In reply to Paul Lew "zsh debug tracing with timestamp" (Apr 14, 11:47pm) References: <15065.17386.300246.739496@paullew-ultra.cisco.com> X-Mailer: Z-Mail (5.0.0 30July97) To: Paul Lew , zsh-users@sunsite.auc.dk Subject: Re: zsh debug tracing with timestamp MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Apr 14, 11:47pm, Paul Lew wrote: } Subject: zsh debug tracing with timestamp } } Any method to insert timestamp in front of the trace command turned on } by set -x? Yes, if you're using 3.1.6 or later. Just set PS4 using any of the usual prompt expansion escapes, e.g.: % PS4=': %D %T ; ' % set -x % sleep 5; echo hello : 01-04-15 12:43 ; sleep 5 : 01-04-15 12:43 ; echo hello hello If you need finer granularity, setopt promptsubst and use $SECONDS: % setopt promptsubst : 01-04-15 12:44 ; setopt promptsubst % PS4=': %D %T {$SECONDS}; ' : 01-04-15 12:44 ; PS4=: %D %T {$SECONDS}; % sleep 5; echo hello : 01-04-15 12:45 {261}; sleep 5 : 01-04-15 12:45 {266}; echo hello hello One-second granularity is the smallest you can get. I chose the :...; format so that you can cut-and-paste the trace output into another shell and the leading timestamps will be ignored. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net