From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from candle.brasslantern.com (IDENT:schaefer@dynamic22.pm02.san-rafael.best.com [206.184.127.86]) by math.gatech.edu (8.9.1/8.9.1) with ESMTP id NAA00477 for ; Sun, 9 Aug 1998 13:48:49 -0400 (EDT) Received: (from schaefer@localhost) by candle.brasslantern.com (8.8.5/8.8.5) id KAA20529; Sun, 9 Aug 1998 10:50:28 -0700 From: "Bart Schaefer" Message-Id: <980809105027.ZM20528@candle.brasslantern.com> Date: Sun, 9 Aug 1998 10:50:27 -0700 In-Reply-To: <19980809123608.01170@astaroth.nit.gwu.edu> Comments: In reply to Sweth Chandramouli "Re: Re: sorting/uniq-ing an array?" (Aug 9, 12:36pm) References: <19980809025636.18149@astaroth.nit.gwu.edu> <980809044123.ZM19065@candle.brasslantern.com> <19980809123608.01170@astaroth.nit.gwu.edu> X-Mailer: Z-Mail (4.0b.820 20aug96) To: Sweth Chandramouli , ZSH Users Subject: Re: sorting/uniq-ing an array? X-Mailing-List: archive/latest/1712 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Aug 9, 12:36pm, Sweth Chandramouli wrote: } Subject: Re: Re: sorting/uniq-ing an array? } } i actually had thought that there was some sort of typeset switch } to do this, but did a man typeset, and didn't see any. i now realize that } the typeset manpage on my machine is for the ksh and csh versions, and that } the zsh one is only in the zshbuiltins manpage. what do people think of } maybe merging [zsh builtins manpages] with the equivalent pages for other } shell builtins? I don't think this is a good idea. For one thing, it means replacing the installed man pages of another app with the man pages from zsh, which may be impossible for many zsh installers. For another, it makes the manpages differ significantly from the info documentation. Then there's the issue of "merging" itself -- when do you propose that this happen? At the time zsh manual pages are installed? Even if we could somehow find, parse, and merge with the existing other shell's manpages, what happens when the other shell or its manpages are updated? } > ports=("${=${${(f)$( } > (Note that there I used ${=...} to re-split the ${(f)...} array of lines, } > so sometimes that _is_ what you want. I did say _almost_ never.) } this works, which surprises me, since that implies that SH_WORD_SPLIT } splits on either spaces or tabs (there are both in my /etc/services as } delimiters between portnames and portnumbers); i thought that IFS was by } default just a space. or am i just misunderstanding what you are doing } here entirely? No, you understand; IFS is by default space, tab, newline, and nul: zagzig% echo $#IFS 4 zagzig% echo x${IFS}x | cat -v x ^@x zagzig% I don't think other shells have nul in IFS by default, but I'm not sure. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com