From 60c307b933c64a886a127a999f581b0d68fea0dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gardais=20J=C3=A9r=C3=A9my?= Date: Mon, 22 Jun 2020 18:23:22 +0200 Subject: [PATCH] Fix: Ensure to grep at least one "-" --- cluster/maco.check.update.sh | 2 +- cluster/sge.enable.host.queue.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cluster/maco.check.update.sh b/cluster/maco.check.update.sh index b095332..b851980 100755 --- a/cluster/maco.check.update.sh +++ b/cluster/maco.check.update.sh @@ -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 diff --git a/cluster/sge.enable.host.queue.sh b/cluster/sge.enable.host.queue.sh index b31ea85..37e3d17 100755 --- a/cluster/sge.enable.host.queue.sh +++ b/cluster/sge.enable.host.queue.sh @@ -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