From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18773 invoked from network); 16 Oct 1997 21:18:50 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 16 Oct 1997 21:18:50 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id RAA00892; Thu, 16 Oct 1997 17:13:10 -0400 (EDT) Resent-Date: Thu, 16 Oct 1997 17:12:02 -0400 (EDT) Date: Thu, 16 Oct 1997 17:12:51 -0400 (EDT) From: Sweth Chandramouli Subject: for syntax differences from ksh To: zsh-users@math.gatech.edu Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Resent-Message-ID: <"NmTV73.0.KC.XCeHq"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1084 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu 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.