Typically, I save the directory-specific settings to .bashrc, and whenever I change the directory, run the command source .bashrcto make these settings effective.
Now I was thinking about manipulating the cd command in ~/.bashrc, so whenever I connect to a new directory and if there is any .bashrc, it will load automatically.
Similar to this cd $1; source .bashrc(I checked that $ 1 is a valid path), but the problem in cd is building a shell, so this is a recursive loop (cd always points to modifed cd). We do not have an ef cd file (which usually has other commands: scp or others). So how can I achieve this? Also, if supported shopt -s cdspell, then I also need to have the cd spelled path in the $ 1 argument.
source
share