Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!mcdchg!heiby From: heiby@mcdchg.UUCP Newsgroups: comp.unix.questions Subject: Re: Korn Shell Message-ID: <222@mcdchg.UUCP> Date: Wed, 11-Mar-87 10:34:16 EST Article-I.D.: mcdchg.222 Posted: Wed Mar 11 10:34:16 1987 Date-Received: Thu, 12-Mar-87 19:32:40 EST References: <580@csun.UUCP> Sender: usenet@mcdchg.UUCP Reply-To: heiby@mcdchg.UUCP (Ron Heiby) Organization: Motorola Microcomputer, Schaumburg, IL Lines: 24 Keywords: alias builtin In article <580@csun.UUCP> aeusesef@csun.UUCP (Sean Eric Fagan) writes: >Yes, that is true. My problem is that 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? The trick is to create a function with a different name, then alias "cd" to the name of that function. Here's part of what I do for "cd". I've omitted the code for the "resetps1" function. function ch { if cd ${*:-''} then resetps1 else return 1 fi } alias cd=ch # make it easy to use -- Ron Heiby, mcdchg!heiby Moderator: mod.newprod & mod.os.unix Motorola Microcomputer Division (MCD), Schaumburg, IL "Save your energy. Save yourselves. Avoid the planet 'cuae2' at all costs!"