Script that works in bash, zsh and tcsh

test "$?BASH_VERSION" != "0" && test "$?ZSH_VERSION" != "0" || goto tcshcmd

foo() {
  echo "running in bash"
}

bar() {
  echo "running in zsh"
}

if [[ -z "$ZSH_VERSION" ]]; then
        foo
else
        bar
fi

exit 0

tcshcmd:

echo "running in tcsh"

if ( "$1" != "") then
  echo "you have passed: $1"
endif