继Q21218074之后,我现在试图问一个问题,让您输入一些程序编号,然后,get-iplayer将读取和下载这些代码。到目前为止,我有-
#!/bin/bash
{
read -n3 -p "Please input the tv programme numbers to download " 'textbox'
case "$ynq" in
[Yy]* ) get-iplayer --get "textbox";;
[Nn]* ) echo;;
[Qq]* ) exit;;
* ) echo "Please answer yes or no. ";;
esac
}您必须在文本框中输入程序编号,脚本读取这些数字并将它们传递给,但是请您怎么做呢?
发布于 2014-01-19 16:11:00
不确定这能回答你的问题,但你似乎想要这个
read -n3 -p "Please input the tv programme numbers to download " 'textbox'
case "$textbox" in
[Yy]* ) get-iplayer --get "$textbox";;
[Nn]* ) echo;;
[Qq]* ) exit;;
* ) echo "Please answer yes or no. ";;
esac注意,在您的示例中,您正在对一个尚未定义的变量执行case语句(除非在其他地方有),而且textbox是一个变量,所以当您将它传递给get时,应该在它前面有$。
https://stackoverflow.com/questions/21218657
复制相似问题