sudo apt-get install expect
expect $filename.sh
filename.sh
#!/usr/bin/expect -f
spawn ~/work/selectdata/run.sh
expect "please input the filename of the file which listed current directory filename"
send -- "dat.txt\n"
expect "please input the listfilename include extension"
send -- "dat.txt\n"
expect "please input the resultfilename include extension"
send -- "result.txt\n"
expect "please input the filename of the file which contain the filename of need to be selected"
send -- "selected.txt\n"
expect "please input the foldername which you want to create and would used as the storage for the selected file"
send -- "selecteddata\n"
interact
阅读(1160) | 评论(0) | 转发(0) |