zsh-users
 help / color / mirror / code / Atom feed
From: Bruce Stephens <b.stephens@isode.com>
To: "David R. Favor" <dfavor@austin.ibm.com>
Cc: Zsh List <zsh-users@math.gatech.edu>
Subject: Re: [Fwd: Parameter Expansion questions]
Date: 17 Aug 1998 16:44:34 +0100	[thread overview]
Message-ID: <vbiujrhau5.fsf@snake.isode.com> (raw)
In-Reply-To: "David R. Favor"'s message of "Mon, 17 Aug 1998 10:17:59 -0500"

"David R. Favor" <dfavor@austin.ibm.com> writes:

>    # paths to search
>    editpath=${EDITPATH:-"$PATH:$CDPATH"}
> 
>    IFS=:
> 
>    if [ $shell_type = 'zsh' ] ; then   <<< $shell_type
>       editpath=${editpath:gs/:/ /}
>    else
>       editpath=$editpath
>    fi
> 
>    IFS="$BACKUP_IFS"
> 
>    for name in $* ; do
> 
>       for dir in ${=editpath} ; do     <<< ${=editpath}
> 
>          # find/edit the file
> 
>       done
> 
>    done

How about replacing

	editpath=${editpath:gs/:/ /}

with

	editpath=(${=editpath})

i.e., you create editpath as an array, which allows the loop to be the
same in ksh and zsh:

	for dir in $editpath; do

That doesn't remove the need for the shell choice earlier, however.


  reply	other threads:[~1998-08-17 15:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-08-17 15:17 David R. Favor
1998-08-17 15:44 ` Bruce Stephens [this message]
1998-08-17 15:52 ` vi wrapper -> vim + "set path" Sven Guckes
1998-08-17 16:08 ` [Fwd: Parameter Expansion questions] Peter Stephenson

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=vbiujrhau5.fsf@snake.isode.com \
    --to=b.stephens@isode.com \
    --cc=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).