.profile

Steven W. Orr steveo at syslang.net
Wed Aug 8 15:16:19 UTC 2007


On Wednesday, Aug 8th 2007 at 14:45 -0000, quoth tony.chamberlain at lemko.com:

=>Does anyone know whether linux has something like a .profile but for cd?
=>
=>That is, you put a script into a directory which gets executed every 
=>time someone CDs to that directory?

It does not, but that doesn't mean you can't write one:

Add (something like) this to you .bashrc

cd ()
{
    builtin cd $1 || return
    [[ -f ./.init ]] && . ./.init   
}

-- 
Time flies like the wind. Fruit flies like a banana. Stranger things have  .0.
happened but none stranger than this. Does your driver's license say Organ ..0
Donor?Black holes are where God divided by zero. Listen to me! We are all- 000
individuals! What if this weren't a hypothetical question?
steveo at syslang.net




More information about the users mailing list