From 988d31dd228c2674c8327db8b6e8ec5e3263a0d7 Mon Sep 17 00:00:00 2001 From: Luk Lu Date: Wed, 8 Mar 2023 09:22:22 +0800 Subject: [PATCH] u --- file-patch.sh | 2 +- file-unpatch.sh | 2 +- geth-install.sh | 8 ++++---- home-config.sh | 2 +- nixhome/.bashrc | 2 +- portscan.sh | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/file-patch.sh b/file-patch.sh index 3576f01..146bb82 100755 --- a/file-patch.sh +++ b/file-patch.sh @@ -2,7 +2,7 @@ PREFIX=%miki SUFFIX=miki% echo sed -i '' "s/$/$SUFFIX/" -if [[ "$(uname)" = "Darwin" ]] +if [ "$(uname)" = "Darwin" ] then LC_CTYPE='C' sed -i '' "s/^/$PREFIX/" $1 LC_CTYPE='C' sed -i '' "s/$/$SUFFIX/" $1 diff --git a/file-unpatch.sh b/file-unpatch.sh index acdb3d6..b0dddc5 100755 --- a/file-unpatch.sh +++ b/file-unpatch.sh @@ -1,7 +1,7 @@ PREFIX=%miki SUFFIX=miki% -if [[ "$(uname)" = "Darwin" ]] +if [ "$(uname)" = "Darwin" ] then LC_CTYPE='C' sed -i '' "s/^$PREFIX//" $1 LC_CTYPE='C' sed -i '' "s/$SUFFIX$//" $1 diff --git a/geth-install.sh b/geth-install.sh index 96bb796..0da2c77 100644 --- a/geth-install.sh +++ b/geth-install.sh @@ -15,18 +15,18 @@ else fi fi -if [[ "$(uname)" = "Linux" ]] +if [ "$(uname)" = "Linux" ] then # 用 dpkg --print-architecture 更直接 ARCH=`dpkg --print-architecture` else - if [[ "$(uname -m)" = "aarch64" ]]; + if [ "$(uname -m)" = "aarch64" ] then ARCH=arm64 - elif [[ "$(uname -m)" = "armv7l" ]]; + elif [ "$(uname -m)" = "armv7l" ] then ARCH=arm - elif [[ "$(uname -m)" = "x86_64" ]]; + elif [ "$(uname -m)" = "x86_64" ] then ARCH=amd64 fi diff --git a/home-config.sh b/home-config.sh index a153ed1..1c44047 100755 --- a/home-config.sh +++ b/home-config.sh @@ -92,7 +92,7 @@ then echo - if [ "$TheUser" != 'root' ] && [[ "$(uname)" != "Darwin" ]] # 仅允许 non-root 用户进行远程密钥登录 + if [ "$TheUser" != 'root' ] && [ "$(uname)" != "Darwin" ] # 仅允许 non-root 用户进行远程密钥登录 then mkdir -p $HomePath/.ssh diff --git a/nixhome/.bashrc b/nixhome/.bashrc index f1dc7d9..e47b7bc 100644 --- a/nixhome/.bashrc +++ b/nixhome/.bashrc @@ -57,7 +57,7 @@ alias fgrep='fgrep --color=auto' alias egrep='egrep --color=auto' alias su='su -' alias npmc='npm --registry https://registry.npm.taobao.org' -if [[ "$(uname)" = "Darwin" ]]; +if [ "$(uname)" = "Darwin" ] then alias l='ls -lG' alias ll='ls -lGA' # show .xxx diff --git a/portscan.sh b/portscan.sh index 674a0a1..c8cc4d4 100644 --- a/portscan.sh +++ b/portscan.sh @@ -6,7 +6,7 @@ else read -p ">>> " PORT fi -if [[ "$(uname)" = "Darwin" ]] +if [ "$(uname)" = "Darwin" ] then lsof -i tcp:$PORT else