#!/bin/bash update() { git pull origin master } if [ -z $1 ]; then var="nothing" else var=$1 fi if [ $var = "update" ]; then update exit 0 fi echo "thats the new end of script"