From 8528199b2eeb2abdda0471c54aeafc4f4dd8f141 Mon Sep 17 00:00:00 2001 From: Dict Xiong Date: Sun, 13 Nov 2022 01:15:57 +0800 Subject: [PATCH] fix regex --- scripts/dogo | 2 +- scripts/doll | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/dogo b/scripts/dogo index 9bf98b4..f79d412 100755 --- a/scripts/dogo +++ b/scripts/dogo @@ -3,7 +3,7 @@ THIS_DIR=$( cd "$( dirname "${BASH_SOURCE[0]:-${(%):-%x}}" )" && pwd ) source "$THIS_DIR/../tools/common.sh" -if [[ -z "$1" || "$1" =~ "-h|--help" ]]; then +if [[ -z "$1" || "$1" =~ ^(-h|--help)$ ]]; then fmt_info "usage: $0 " else $SUDO docker exec -it $1 sh -c 'if [ -x "$(command -v zsh)" ]; then zsh; elif [ -x "$(command -v bash)" ]; then echo "-->bash"; bash; else echo "-->sh"; sh; fi' diff --git a/scripts/doll b/scripts/doll index 958a130..f59671e 100755 --- a/scripts/doll +++ b/scripts/doll @@ -3,7 +3,7 @@ THIS_DIR=$( cd "$( dirname "${BASH_SOURCE[0]:-${(%):-%x}}" )" && pwd ) source "$THIS_DIR/../tools/common.sh" -if [[ -z "$1" || "$1" =~ "-h|--help" ]]; then +if [[ -z "$1" || "$1" =~ ^(-h|--help)$ ]]; then fmt_info "usage: $0 " else $SUDO docker run -itd $1 sh