[plug] bash: making cd persist after script has run

Leon Brooks leon at brooks.fdns.net
Mon Feb 11 10:47:04 WST 2002


On Monday 11 February 2002 10:22, Colin Muller wrote:
> Then I placed this (named ccd) in my home directory, and typed:
> ~/ccd xml
> ~/ccd perl
> etc etc

alias ccd='. ~/ccd'

Put that in a startup file like .bashrc - the '. ' prefix says ``execute this 
script within the current shell'', what is happening now is that the script 
is being run in a sub-shell, changing the sub-shell's cd, then the sub-shell 
exits.

If you're an ex-Windows user, this is also a helpful alias:

alias cd..='cd ..'



More information about the plug mailing list