Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!ames!ptsfa!ihnp4!homxb!houxm!houxa!grs From: grs@houxa.UUCP Newsgroups: comp.unix.questions Subject: Re: Korn Shell (alias for 'cd') Message-ID: <350@houxa.UUCP> Date: Tue, 24-Mar-87 14:18:27 EST Article-I.D.: houxa.350 Posted: Tue Mar 24 14:18:27 1987 Date-Received: Thu, 26-Mar-87 04:58:39 EST References: <580@csun.UUCP> <2295@tektools.TEK.COM> Organization: AT&T Bell Laboratories, Holmdel Lines: 31 Keywords: Korn shell ksh aliases parameters oops Summary: Better to use a functions In article <2295@tektools.TEK.COM>, jerryp@tektools.TEK.COM (Jerry Peek) writes: > In article <580@csun.UUCP> aeusesef@csun.UUCP (Sean Eric Fagan) writes: > > ... I would like to alias cd, which Korn > > shell will allow me to do. Apparantly, it looks through aliases first, > > built-ins second, functions third, and PATH fourth. I tried making a > > function called cd, but it didn't work, and an alias called cd did work, but > > I was unable to pass parameters into it. Any one have any suggestions? > > I have an alias like this; it takes commandline parameters just fine: > > alias cd='. $HOME/.ksh/cd' # CHANGE DIRECTORY, RESET PROMPT > > Here's what's in the $HOME/.ksh/cd file: > The preferred way to do this is to create a function which performs the change directory, and then alias cd to that function. For example: alias cd=chdir chdir() { cd $1 PS1="$PWD >" } or whatever. Glenn Sills BTL Merrimack Valley !houxa!grs