利用shell脚本交互式运行jar任务
作者:互联网
如题,废话不多说,直接上代码:
#!/bin/bash
APP_PATH=/root/bigdata/neural_networks/width_control_model/predict/upload_parameter
APP_NAME=upload_parameter.jar
ARGS0=/root/bigdata/neural_networks/data/430/sczpp/result/201910161057
ARGS1=/root/bigdata/neural_networks/data/430/cswp/result/201910161057
echo "sczpp模型参数文件夹目录为:${ARGS0}"
read -p "sczpp模型参数目录需要修改吗?[Y/n](n)" ANSWER
case $ANSWER in
Y|y|yes) read -p "sczpp模型参数目录修改为:" ARGS0
;;
esac
echo "cswp模型参数文件夹目录为:${ARGS1}"
read -p "cswp模型参数目录需要修改吗?[Y/n](n)" ANSWER
case $ANSWER in
Y|y|yes) read -p "cswp模型参数目录修改为:" ARGS1
;;
esac
cd $APP_PATH
java -jar $APP_NAME $ARGS0 $ARGS1
在Linux环境下运行shell脚本,能实现args参数动态输入。
标签:shell,read,jar,sczpp,参数,交互式,ANSWER,ARGS1,cswp 来源: https://www.cnblogs.com/steven0325/p/11691381.html