From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14915 invoked from network); 9 Oct 2003 17:49:46 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 9 Oct 2003 17:49:46 -0000 Received: (qmail 16449 invoked by alias); 9 Oct 2003 17:49:28 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6674 Received: (qmail 16430 invoked from network); 9 Oct 2003 17:49:28 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 9 Oct 2003 17:49:28 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [195.64.83.12] by sunsite.dk (MessageWall 1.0.8) with SMTP; 9 Oct 2003 17:49:27 -0000 Received: by timix.globnix.org with local id 1A7euk-0003oC-00; Thu, 09 Oct 2003 17:49:26 +0000 Date: Thu, 9 Oct 2003 17:49:26 +0000 From: Phil Pennock To: zsh-users@sunsite.dk Subject: Re: Useful zsh/datetime things Message-ID: <20031009174926.GA12280@globnix.org> Mail-Followup-To: zsh-users@sunsite.dk References: <1031009172754.ZM10491@candle.brasslantern.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1031009172754.ZM10491@candle.brasslantern.com> On 2003-10-09 at 17:27 +0000, Bart Schaefer wrote: > A useful addition to strftime would be an option to assign the result to a > parameter, similar to the -A and -H options of "stat" (from zsh/stat). Reminding myself about this stuff led me to try something, the results of which have me slightly confused. I'm trying to figure out what's happening with "print -l" here. % stat -H foo -s . % print -l ${(kv)foo} | pr -at2 % print -l "${(@kv)foo}" | pr -at2 The second command doesn't give proper results, since there is no value shown for the key 'link', so after that things are mis-placed. But why is there not a blank line? If the key exists but is undefined, it's the empty string? The third command shows that when treated as the argument "", a blank line is shown and pr(1) can recombine things correctly. Given that there's no white-space splitting happening, why does the second print differ from the others? % print -l alpha '' beta '' gamma % s='' % print -l alpha $s beta $s gamma % print -l alpha "$s" beta "$s" gamma % print $ZSH_VERSION 4.0.6 If I had SH_WORD_SPLIT set, this would make more sense, but I don't. Behaviour verified with "zsh -f". I'm missing something really obvious, aren't I? -- 2001: Blogging invented. Promises to change the way people bore strangers with banal anecdotes about their pets.