- Pwdrc - http://www.freaknet.org/alpt/src/utils/pwdrc Pwdrc lets you executes your set of commands each time you walk in a directory with `cd'. You can associate a different set of commands to each directory. *** USAGE Each time you walk in a directory the file .`whoami`_pwdrc is read and executed (if it exists), thus if your user name is "foo", your pwdrc file is ".foo_pwdrc". You can use the `cdd' command, instead of `cd', to avoid the execution of the pwdrc file. *** WARNING *** Pwdrc executes _ONLY_ pwdrc file which are owned by your user name and cannot be read/written/executed by anyone else than yourself. So be sure to use: chmod 600 .`whomai`_pwdrc *** WARNING *** When you exit from the directory where you put a pwdrc file, Pwdrc executes the function close_pwdrc() which was defined in it. This is useful to restore aliases you have modified (see the COOKBOOK section below in this text). If you set, in your pwdrc file, the PDWRC_RECURSE variable to 1, then close_pwdrc() will be called only when you walk in a upper directory. If the variable PWDRC_RECURSE_FUNC is set to 1 the function recurse_pwdrc() will be called each time you walk in a sub-directory. For example, the pwdrc script below will print the current path each time you walk into a sub-directory: PWDRC_RECURSE_FUNC=1 recurse_pwdrc() { pwd } NOTE: Please use unique variable names in your pwdrc files, since they may collide with other pwdrc variables when PDWRC_RECURSE is enabled. NOTE2: It is adviced to put close_pwdrc() at the beginning of your pwdrc file. Examples: If you want to do an `ls' each time you walk in the directory pkg/ just do: echo ls > pkg/.`whoami`_pwdrc chmod 600 pkg/.`whoami`_pwdrc In order to walk in pkg/ without executing the pwdrc file do: cdd pkg/ *** INSTALLATION Copy http://freaknet.org/alpt/src/utils/pwdrc/pwdrc.sh in /yourpath/to/pwdrc/ Put the code below at the end of your .bashrc: source /yourpath/to/pwdrc/pwdrc.sh *** COOKBOOK Go at http://freaknet.org/alpt/src/utils/pwdrc/cookbook/ there are some useful pwdrc file you can use. -- AlpT (@freaknet.org)