From: "David R. Favor" <dfavor@austin.ibm.com>
To: Zsh List <zsh-users@math.gatech.edu>
Subject: Parameter Expansion questions
Date: Mon, 17 Aug 1998 08:57:55 -0500 [thread overview]
Message-ID: <35D836E3.F7BEBC77@austin.ibm.com> (raw)
In ksh, word splitting occurs auto-magically via setting IFS, thus:
SAVEIFS="$IFS"
IFS=:
splitpath=$PATH
IFS="$SAVEIFS
results in $splitpath having $PATH contents with ':' characters changed
to blanks.
In zsh, I'm having a challenge deciphering the manual about parameter
expansion options. I've tried the following, without success. All fragments
set $IFS=: before expansion:
export SH_WORD_SPLIT // explicit 'set SH_WORD_SPLIT'
splitpath=$*
and
splitpath=${=PATH} // implicit 'set SH_WORD_SPLIT'
and
splitpath=${buf:s:':':} // word split s:char:
Can someone let me know what I'm doing wrong in each of these situations?
I did figure out that this works:
splitpath=${buf:gs/:/ /}
Also,
Also, a pointer to some good examples of parameter expansion would be great.
Thanks.
next reply other threads:[~1998-08-17 14:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-08-17 13:57 David R. Favor [this message]
1998-08-17 14:45 ` Zefram
1998-08-17 15:10 ` Bruce Stephens
1998-08-17 17:09 ` Bart Schaefer
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=35D836E3.F7BEBC77@austin.ibm.com \
--to=dfavor@austin.ibm.com \
--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).