Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ukma!rutgers!att!ihuxy!dawn1 From: dawn1@ihuxy.ATT.COM (Dawn E. Howe ) Newsgroups: comp.unix.questions Subject: Re: ksh alias question (I'm not proud) Message-ID: <2967@ihuxy.ATT.COM> Date: 2 May 89 13:15:11 GMT References: <292@tree.UUCP> Organization: AT&T Bell Laboratories - Naperville, Illinois Lines: 31 From article <292@tree.UUCP>, by stever@tree.UUCP (Steve Rudek): > I thought I'd save myself some typing by building a file of paths to all > my favorite directories and then defining the following alias. > alias G='cd `grep $1 /usr/local/ut/paths`' > It doesn't work--for the obviously reason that $1 isn't making it to the > subshell. I've tried all manner of nested quotes. Suggestions on how to > do this? I'd guess it could be done with an eval...but is that really > necessary? I don't have an answer for how to get your command to work, but there is something to do this ALREADY BUILT INTO KSH. Set (and export) the variable CDPATH to a colon(:)-separated list of "favorite directories". The working directory is specified by a . or a Null directory name, which can appear before the first :, after the last :, or between : delimiters. Here's how it works: -------------------- If the directory that you specify for "cd" does not begin with a /, then ksh searches each of the directories in the CDPATH in order for the specified directory, and tries to cd to that directory. Hope this helps. Dawn E. Howe AT&T Bell Labs ...dawn1@ihuxy.att.com or ...att!ihuxy!dawn1