Normally if you do ./ your script is run in a subshell so whatever happens in that one is not affected by the caller shell.

I wanted to write a script to affect the caller, eg shortcut cd-ing for example.


echo "cd /tmp/foo/bar/baz/$1" >

./ "yolo" # No effect at all

. "yolo" # Your current dir changes to /tmp/foo/bar/baz/yolo

You can also put this into ~/.bashrc as an alias so you can easily call without remembering the full path

alias void='. /a/b/c/'
source ~/.bashrc 
void  # Thank me later.