I am writing a script to set environment variables on linux 2.6 using bash. So the script contains commands like:
export SRC_DIR=.. export LIBPATH=${SRC_DIR}/lib
For keeping error code:
function getPwd() { $(cd $1; [[ $? -ne 0 ]] && exit 1 || echo echo $PWD;) return $? }