Pwdrc 0.0.3

Pwdrc executes a set of commands each time you walk in a directory with "cd".

  Add it to your Download Basket!

 Add it to your Watch List!


Rate it!
send us
an update
GPL (GNU General Public License) 
5.0/5 3
ROOT \ Utilities
Pwdrc project executes a set of commands each time you walk in a directory with "cd". You can associate a different set of commands to each directory.

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".


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


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.

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.


If you want to do an `ls' each time you walk in the directory pkg/ just

echo ls > pkg/.`whoami`_pwdrc
chmod 600 pkg/.`whoami`_pwdrc

In order to walk in pkg/ without executing the pwdrc file do:

cdd pkg/


Copy in /yourpath/to/pwdrc/

Put the code below at the end of your .bashrc:

source /yourpath/to/pwdrc/

What's New in This Release:

recurse_pwdrc() has been added in the set of definable functions, and it is called each time the user walks into a sub-directory.
The "todo_remider" cookbook has been improved.
It doesn't conflict anymore if used in multiple directories, and it supports the shuffling of the output to increase the user's attention.

Last updated on May 28th, 2006

#commands executor #cd directory #system utilties #Pwdrc #cd #commands #system

Add your review!