shell脚本修改jar包内文件

#输入要修改的jar文件
echo "Please Input jar Name:(jar/servcie.jar)"
read jarName
#输入要修改jar内部文件名称
echo "Please Input file Name:(config.properties)"
read fileName
jar tvf $jarName |grep $fileName
#查询到的文件,选择要修改的文件
echo "Query out as follows,Please select the copy you want:"
read oldFilePath
jar xvf $jarName $oldFilePath
sleep 1
#复制你需要修改的文件
echo "Please Input replace file path:(like:config/config.properties)"
read newFilePath
cp $newFilePath $oldFilePath
echo "Replace success!"
jar uvf $jarName $oldFilePath
sleep 1
java -jar $jarName &
posted @ 2019-05-30 19:12  夏天的棒棒冰  阅读(1680)  评论(0编辑  收藏  举报