From 6d05b126c09232875f9f6ca81fd05237fab92bc4 Mon Sep 17 00:00:00 2001 From: rallets Date: Mon, 4 Dec 2017 16:01:42 +0800 Subject: [PATCH] fixed Replace bug --- zsh/functions.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zsh/functions.zsh b/zsh/functions.zsh index 4a14e3e..58ca7cb 100644 --- a/zsh/functions.zsh +++ b/zsh/functions.zsh @@ -91,13 +91,13 @@ function docker_rm_all() { docker rm -f `docker ps --no-trunc -aq` } function Replace () { - if [ "$(uname)" == "Darwin" ]; then + if [[ "$(uname)" == "Darwin" ]]; then if [ "$#" -eq 3 ]; then ag $2 -l -G $1 | xargs sed -i '' s/$2/$3/g elif [ "$#" -eq 2 ]; then ag $1 -l | xargs sed -i '' s/$1/$2/g fi - elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then + elif [[ "$(expr substr $(uname -s) 1 5)" == "Linux" ]]; then if [ "$#" -eq 3 ]; then ag $2 -l -G $1 | xargs sed -i s/$2/$3/g elif [ "$#" -eq 2 ]; then