欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

mac sed 正则表达式匹配空格

程序员文章站 2022-03-14 22:29:15
...

mac sed 正则表达式匹配空格

[[:space:]]匹配空格和Tab

#!/bin/sh
basePath="/Users/whuanghkl/code/IdeaProjects/lanproxy"
cd $basePath
ConfigJavaFile="/Users/whuanghkl/code/IdeaProjects/lanproxy/proxy-common/src/main/java/org/fengfei/lanproxy/common/Config.java"
sed -i '' 's/isDebug[[:space:]]*=[[:space:]]*true/isDebug = false/' $ConfigJavaFile
mvn clean install
result2=$?
echo $result2
if [ $result2 -ne 0 ];then
    echo "error."
    exit 4
fi
cd distribution/proxy-server-0.0.1
chmod a+x ./bin/startup.sh
chmod a+x ./bin/stop.sh
cd $basePath
cd distribution/proxy-client-0.0.1
chmod a+x ./bin/startup.sh
chmod a+x ./bin/stop.sh
cp /Users/whuanghkl/code/mygit/io0007/target/io0007-0.0.1-SNAPSHOT.jar  /Users/whuanghkl/code/mysvn/java_bin/bin/proxy-client-0.0.1/lib/
cp /Users/whuanghkl/code/IdeaProjects/lanproxy/proxy-client/target/proxy-client-0.0.1.jar /Users/whuanghkl/code/mysvn/java_bin/bin/proxy-client-0.0.1/lib/
cd /Users/whuanghkl/code/mysvn/java_bin/bin/proxy-client-0.0.1/lib/
svn commit -m "update proxy-client-0.0.1.jar" proxy-client-0.0.1.jar
sed -i '' 's/isDebug[[:space:]]*=[[:space:]]*false/isDebug = true/' $ConfigJavaFile

 

相关标签: sed匹配空格