bash script functioning