Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am dhruvsinghal on github.
  • I am dhruvsinghal (https://keybase.io/dhruvsinghal) on keybase.
  • I have a public key ASCpwSeQQR5BEhLMuCVL2tDp1aMZ8gri17I2vJn29I0nugo

To claim this, I am signing this object:

@dhruvsinghal
dhruvsinghal / Autoexec_setvars
Last active August 29, 2015 13:59
Automatically execute a script labelled setvars.sh if it occurs in any of the ancesstor of the directory being cd'ed into.
function exec_setvars {
if [ "$(readlink -f $1)" != "/" ]; then
if [ -f "$1/setvars.sh" ]; then
builtin cd $1
set -a
source ./setvars.sh
builtin cd $2
echo "$(tput setab 3)Executed source setvars.sh$(tput sgr 0)"
else
exec_setvars $1/.. $2