Bash - execute a function before exiting a script

01 Jul 2020

Exite a function before exiting the script:

function mvBack {
  echo "... go back to my folder"
  cd $runDir  
}
trap mvBack EXIT
[ bash  function  ]