cd function

Boyd Roberts boyd at necisa.ho.necisa.oz.au
Tue Feb 19 10:33:22 AEST 1991


The V8 shell is the way to go:

    cd()
    {
	builtin cd $1 &&
	case "$1" in
	'')
	    PS1="% " ;;
	..|*/..)
	    PS1="`basename \`/bin/pwd\``% " ;;
	/)
	    PS1="/% " ;;
	*/*)
	    PS1="`basename $1`% " ;;
	*)
	    PS1="$1% " ;;
	esac
    }

Of course, as Doug said, you need `builtin' or you have to rename the function.


Boyd Roberts			boyd at necisa.ho.necisa.oz.au

``When the going gets wierd, the weird turn pro...''



More information about the Comp.unix.questions mailing list