Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [Fwd: Parameter Expansion questions]
- X-seq: zsh-users 1724
- From: Bruce Stephens <b.stephens@xxxxxxxxx>
- To: "David R. Favor" <dfavor@xxxxxxxxxxxxxx>
- Subject: Re: [Fwd: Parameter Expansion questions]
- Date: 17 Aug 1998 16:44:34 +0100
- Cc: Zsh List <zsh-users@xxxxxxxxxxxxxxx>
- In-reply-to: "David R. Favor"'s message of "Mon, 17 Aug 1998 10:17:59 -0500"
- References: <35D849A7.4EB5F516@xxxxxxxxxxxxxx>
- Sender: B.Stephens@xxxxxxxxx
"David R. Favor" <dfavor@xxxxxxxxxxxxxx> 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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author