This commit is contained in:
陆柯 2023-03-08 09:22:22 +08:00
parent 840b9e9da8
commit 988d31dd22
6 changed files with 9 additions and 9 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -6,7 +6,7 @@ else
read -p ">>> " PORT
fi
if [[ "$(uname)" = "Darwin" ]]
if [ "$(uname)" = "Darwin" ]
then
lsof -i tcp:$PORT
else