zsh-users
 help / color / mirror / code / Atom feed
* Parameter Expansion questions
@ 1998-08-17 13:57 David R. Favor
  1998-08-17 14:45 ` Zefram
  0 siblings, 1 reply; 4+ messages in thread
From: David R. Favor @ 1998-08-17 13:57 UTC (permalink / raw)
  To: Zsh List

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.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1998-08-17 17:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-08-17 13:57 Parameter Expansion questions David R. Favor
1998-08-17 14:45 ` Zefram
1998-08-17 15:10   ` Bruce Stephens
1998-08-17 17:09   ` Bart Schaefer

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).