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 &


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM