From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18406 invoked from network); 26 Apr 2002 01:58:09 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 26 Apr 2002 01:58:09 -0000 Received: (qmail 21168 invoked by alias); 26 Apr 2002 01:57:50 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 4879 Received: (qmail 21152 invoked from network); 26 Apr 2002 01:57:48 -0000 From: "Joshua Symons" To: Bart Schaefer Cc: zsh-users@sunsite.dk Message-ID: <2569b26067.260672569b@mysun.com> Date: Thu, 25 Apr 2002 20:54:53 -0500 X-Mailer: Netscape Webmail MIME-Version: 1.0 Content-Language: en Subject: Re: Preexec & Printf X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: 7bit ${(qV)1} appears to be doing the job in 3.1.9, in 3.0.8 (the version that comes with solaris 9) or 3.0.6 (the version that comes with solaris 8) it gives a syntax error. However with ${(QV)1} I still get garbage into my shell. [(ichirou:38:pts/22)~ %] which preexec preexec () { print -Pn "\e]0;%m:%l - ${(QV)1} \a" } [(ichirou:39:pts/22)~ %] printf '^[[32;40mwith quotes\n' with quotes [(ichirou:40:pts/22)~ %] [(ichirou:40:pts/22)~ %] which preexec preexec () { print -Pn "\e]0;%m:%l - ${(qV)1} \a" } [(ichirou:41:pts/22)~ %] printf '^[[32;40mwith quotes\n' with quotes [(ichirou:42:pts/22)~ %] - Josh - ----- Original Message ----- From: Bart Schaefer Date: Thursday, April 25, 2002 8:45 pm Subject: Re: Preexec & Printf > On Thu, 25 Apr 2002, Joshua Symons wrote: > > > I had seen q in the modifier list @ > > http://zsh.sourceforge.net/Doc/Release/zsh_13.html#SEC45 > > I don't see V and z in the modifier list, are they documented? > > Unfortunately that's still the 3.0 -- or perhaps it's 3.1.6 -- > documentation. You need to read the docs that came with your zsh > distribution if you want accurate information. > > > Additionally, where is the $* vs $1 documented, since I'm > accustomed to > > $*. > > The 3.1.9 doc (which I just happen to have lying around) says under > thepreexec function: > > ... If the history mechanism is active, the string to be > executed is passed as an argument. > > Note "as AN argument", that is, the first and in this case only > argument,which is $1. $* means all the arguments. > > In 4.0.4, this has changed: > > ... If the history mechanism is active (and the line was not > discarded from the history buffer), the string that the user > typed is passed as the first argument, otherwise it is an empty > string. The actual command that will be executed (including > expanded aliases) is passed in two different forms: the second > argument is > a single-line, size-limited version of the command (with things > like function bodies elided); the third argument contains the > full text what what is being executed. > > So in 4.0.4 if you use $* you'll get the command repeated three times, > which is definitely not what you want. If you had 4.0.4, you'd > probablywant ${(QV)2} or maybe just ${(V)2}. > >