Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
for syntax differences from ksh
- X-seq: zsh-users 1084
- From: Sweth Chandramouli <sweth@xxxxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxxxxxxx
- Subject: for syntax differences from ksh
- Date: Thu, 16 Oct 1997 17:12:51 -0400 (EDT)
i wrote the following function in ksh to easily add directories
to my path. it worked fine there, but when i try to use it in zsh, it fails.
addpath () {
for pathdir in $*; do
if test -d $pathdir; then
PATH=$PATH:$pathdir
fi;
done
}
in my .zshenv, this fn is then called with a list of dirs as its
argument (actually, the line is
addpath $pathlist
where pathlist is defined as the list of dirs, separated by spaces). the
for loop, which in ksh interprets the list of dirs as a list, works fine,
in zsh instead interprets the list as one large directory name; the test
-d then fails, and no dirs are added to the path. so what is the proper
syntax for doing this? and is there someplace that lists the
logic/syntax for the various shell operators in zsh, and how they differ
from ksh? i've picked up a few, through trial and error, but haven't yet
found a good reference.
tia,
sweth.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author