zsh-users
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@brasslantern.com>
To: Sweth Chandramouli <sweth@astaroth.nit.gwu.edu>,
	ZSH Users <zsh-users@math.gatech.edu>
Subject: Re: sorting/uniq-ing an array?
Date: Sun, 9 Aug 1998 10:50:27 -0700	[thread overview]
Message-ID: <980809105027.ZM20528@candle.brasslantern.com> (raw)
In-Reply-To: <19980809123608.01170@astaroth.nit.gwu.edu>

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)$(</etc/services)}:#\#*}%%/*}")
} > 
} > (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


  reply	other threads:[~1998-08-09 17:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-08-09  6:56 Sweth Chandramouli
1998-08-09 11:41 ` Bart Schaefer
1998-08-09 16:36   ` Sweth Chandramouli
1998-08-09 17:50     ` Bart Schaefer [this message]
1998-08-10 11:34     ` Bruce Stephens

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=980809105027.ZM20528@candle.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=sweth@astaroth.nit.gwu.edu \
    --cc=zsh-users@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).