Changing directories in ksh...

Lawrence V. Cipriani lvc at tut.cis.ohio-state.edu
Tue Jul 5 00:11:38 AEST 1988


In article <5318 at dasys1.UUCP> pepper at 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?? Shell
>scripts ain't the answer, because once I get to a new directory, I want
>to STAY there. Also, ksh's alias isn't as...ummm...err..."intelligent"
>as csh's alias.

This is a weakness in ksh, but there is a work around.  Use a ksh
function:

	function down
	{
		cd "${@}" ; ls
	}

and put it in your .profile or ENV file.  You could put quote marks
around the cd and ls if you don't want alias processing on them.


-- 
Larry Cipriani, AT&T Network Systems and Ohio State University
Domain: lvc at tut.cis.ohio-state.edu
Path: ...!cbosgd!osu-cis!tut.cis.ohio-state.edu!lvc (strange but true)



More information about the Comp.unix.questions mailing list