- 论坛徽章:
- 0
|
求助
1。我要直接执行某程序executefile,有的步骤有交互需要用户选择,比如./executefile 提示“1 for A; 2 for B”(如果A在选择a,b或输入其他).每次执行完之后我还要写些文件整理和数据提取等操作。现在希望写个shell脚本来执行。但我只是想通过文件给他传递“部分步骤的指令”,其他仍正常通过在运行的终端中传递。
2。如果每次执行executefile需要陆续给定十个输入后执行运算,如果我把所有需要传递的10个参数都写入input,则执行./executefile< input没有问题,但这失去了根据情况控制的作用。但是我在input 中不给全10个,那程序运行失败直接跳出。我想的是部分参数例如5个写入input,传递给executefile执行,其他的等待我的输出。特此请教大家?
rm -f read.dat
touch read.dat
if [[ "$1"=="" ]];then
echo "what is the name"
read inname
else
inname=$1
fi
outname=$inname_out
echo "1 ">>read.dat
echo "$inname" >> read.dat
eval echo \$outname >> read.dat
./executefile < read.dat
....
....
。。。 |
|