Răsfoiți Sursa

Update sssh.sh

Changed regex for project number backward compatible to old bash versions
erdo_king 8 ani în urmă
părinte
comite
933eeab17a
1 a modificat fișierele cu 1 adăugiri și 1 ștergeri
  1. 1 1
      sssh.sh

+ 1 - 1
sssh.sh

@@ -92,7 +92,7 @@ function print_projectmenu() {
         GROUP_FILTER=
         GROUP_FILTER=
 
 
         ## check if given projectname or projectnumber
         ## check if given projectname or projectnumber
-        if [[ "$1" == ?(-)+([0-9]) ]]; then
+        if [[ $1 =~ ^[0-9]+$ ]] ; then
           ## projectnumber, read projectname from "projects" string
           ## projectnumber, read projectname from "projects" string
           project=$( echo $projects | cut -d ":" -f "$1" )
           project=$( echo $projects | cut -d ":" -f "$1" )
         else
         else