Fix: Ensure to grep at least one "-"

This commit is contained in:
Jeremy Gardais 2020-06-22 18:23:22 +02:00
parent 4535850b3a
commit 60c307b933
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
2 changed files with 3 additions and 3 deletions

View File

@ -225,7 +225,7 @@ if [ ! "${NBARGS}" -eq "0" ]; then
manage_arg="0"
# Parse all options (start with a "-") one by one
while printf -- '%s' "${1}" | grep -q -E -- "^-*"; do
while printf -- '%s' "${1}" | grep -q -E -- "^-+"; do
case "${1}" in
-h|--help ) ## help

View File

@ -320,7 +320,7 @@ if [ ! "${NBARGS}" -eq "0" ]; then
manage_arg="0"
## If the first argument is not an option
if ! printf -- '%s' "${1}" | grep -q -E -- "^-*";
if ! printf -- '%s' "${1}" | grep -q -E -- "^-+";
then
## Use this argument for sge_hostname
sge_hostname="${1}"
@ -337,7 +337,7 @@ if [ ! "${NBARGS}" -eq "0" ]; then
fi
# Parse all options (start with a "-") one by one
while printf -- '%s' "${1}" | grep -q -E -- "^-*"; do
while printf -- '%s' "${1}" | grep -q -E -- "^-+"; do
case "${1}" in
-d|--debug ) ## debug