function locate_source { tarball=$( ls *.tar.* | wc -l ) if [ $tarball -gt "1" ]; then echo "More than one tarball here" exit else found=$( ls *.tar.* ) echo "I found the following sources:" echo " " echo ${found/%-[0-9]*/} $APP=$found echo " " fi }