diff --git a/crSh b/crSh old mode 100644 new mode 100755 index 822524a..3696083 --- a/crSh +++ b/crSh @@ -12,13 +12,27 @@ usage $1 if [ $? = 1 ]; then echo "Skryptname eingeben: " read file + file="${file}.sh" else - file=$1 + file="${1}.sh" fi +x="false" +while [ "$x" = "false" ] +do +if [ ! -e ${file} ]; then + x="true" +else + echo "existiert bereits !!!!" + echo "neuen Skryptname eingeben: " + read file + file="${file}.sh" +fi +done + exec 3> /dev/null -touch ./${file}.sh >&3 -chmod a+x ${file}.sh >&3 -echo '#!/bin/bash' >> ${file}.sh -geany ${file}.sh & +touch ./${file} >&3 +chmod a+x ${file} >&3 +echo '#!/bin/bash' >> ${file} +geany ${file} & exec 3>&- exit 0