mirror of
https://github.com/DictXiong/dotfiles.git
synced 2025-12-20 04:57:49 +08:00
fix regex
This commit is contained in:
parent
02c3a3889f
commit
8528199b2e
@ -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'
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user