Path: utzoo!attcan!uunet!husc6!rutgers!att!skep2!wcs From: wcs@skep2.ATT.COM (Bill.Stewart.[ho95c]) Newsgroups: comp.unix.questions Subject: Re: Changing directories in ksh... Message-ID: <179@skep2.ATT.COM> Date: 4 Jul 88 21:25:57 GMT References: <5318@dasys1.UUCP> Reply-To: wcs@skep2.UUCP (46323-Bill.Stewart.[ho95c],2G218,x0705,) Organization: AT&T Bell Labs Center 4632, Holmdel, NJ Lines: 23 In article <5318@dasys1.UUCP> pepper@dasys1.UUCP (Angeli "Ms. Pepper" Wahlstedt) writes: > Normally, I'd have an alias in "csh" that looks like this: > alias down 'cd \!^; ls' > But, here's the fun part...how do I do the same thing in ksh?? ... > Also, ksh's alias isn't as...ummm...err..."intelligent" :as csh's alias. Either you convince alias to give you access to arguments (i.e. read the manual which I don't have here), or use shell functions down(){ cd $* ; ls -FC } Shell functions are an SVR2 shell feature which ksh also supports. A side benefit is that if you find yourself on a system that doesn't have ksh, shell functions can let you create many of your favorite aliases. The really fun part is if you want your command name to be "cd". It's possible, but you have to do just the right things with order-of-evaluation differences between built-ins, aliases, and functions, and go three or so layers deep. -- # Thanks; # Bill Stewart, AT&T Bell Labs 2G218, Holmdel NJ 1-201-949-0705 ihnp4!ho95c!wcs Rnmail: .signature too boring - deleted