fix regex

This commit is contained in:
Dict Xiong 2022-11-13 01:15:57 +08:00
parent 02c3a3889f
commit 8528199b2e
2 changed files with 2 additions and 2 deletions

View File

@ -3,7 +3,7 @@
THIS_DIR=$( cd "$( dirname "${BASH_SOURCE[0]:-${(%):-%x}}" )" && pwd ) THIS_DIR=$( cd "$( dirname "${BASH_SOURCE[0]:-${(%):-%x}}" )" && pwd )
source "$THIS_DIR/../tools/common.sh" source "$THIS_DIR/../tools/common.sh"
if [[ -z "$1" || "$1" =~ "-h|--help" ]]; then if [[ -z "$1" || "$1" =~ ^(-h|--help)$ ]]; then
fmt_info "usage: $0 <container>" fmt_info "usage: $0 <container>"
else 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' $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'

View File

@ -3,7 +3,7 @@
THIS_DIR=$( cd "$( dirname "${BASH_SOURCE[0]:-${(%):-%x}}" )" && pwd ) THIS_DIR=$( cd "$( dirname "${BASH_SOURCE[0]:-${(%):-%x}}" )" && pwd )
source "$THIS_DIR/../tools/common.sh" source "$THIS_DIR/../tools/common.sh"
if [[ -z "$1" || "$1" =~ "-h|--help" ]]; then if [[ -z "$1" || "$1" =~ ^(-h|--help)$ ]]; then
fmt_info "usage: $0 <image>" fmt_info "usage: $0 <image>"
else else
$SUDO docker run -itd $1 sh $SUDO docker run -itd $1 sh