技术解析
下午碰到一个 shell 的问题,也不知道用什么关键字搜索,哪位高人知道怎么解决?
$ BUILD_VER=`curl -s --connect-timeout 60 localhost:${PORT}/serverStatus.jsp | grep Build | sed -e 's/^[ \t]*//'`
$ BUILD_VER+=.war
$ echo $BUILD_VER
.war4_Build-20160114144502 <-- 错误的版本号, war 扩展名怎么跑到前面把 BUILD_VER 的前 4 个字符覆盖了?
$ BUILD_VER=3.9.4_Build-20160114144502
$ BUILD_VER+=.war
$ echo $BUILD_VER
3.9.4_Build-20160114144502.war <-- 正确的版本号