我对脚本编写(自学)还很陌生,但并非一无所知。我正在尝试为程序版本集制作易于安装的脚本,并且遇到了一些困难。这是代码的修改版本
(
echo "deb http://blah.blahblah.net/blah/blah/ubuntu precise main" | tee/etc/apt/sources.list.d/blahblah.list
echo "deb-src http://blah.blahblah.net/blah/blah/ubuntu precise main" | tee -a /etc/apt/sources.list.d/blahblah.list
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys blah000000
apt-get update
`
echo "please select the Version of blah you want ************ 1)blah1 2)blah2 3)blah3 4)All (1,2,3) 5)I will do this manualy (in the software center)"
read n
case $n in
1) apt-get install blah1;;
2) apt-get install blah2;;
3) apt-get install blah3;;
4) apt-get install blah1 blah2 blah3;;
5) echo "Thank you and have a nice day. :-)" exit;;
*) invalid option;;
esac
)
它将完成apt更新,但之后会给我此消息
(
blah 1-2-3-installer_beta.sh: 22: blah 1-2-3-installer_beta.sh: Syntax error: EOF in backquote substitution
)
任何建议.....(旁注:“ blah”没关系,我已经检查过)
我正在运行Ubuntu 14.04.3“ Trusty”和Linux Mint 17.3“ cinnamon”
您的`
代码中有一个反引号(),但末尾的反引号并未对其进行补充。目前尚不清楚您对反引号的处理方式。
$()
反引号用于命令替换,也开始用于命令替换,而不是较旧且有问题的反引号。
要解决您当前的问题,只需`
在该apt-get update
行后的单引号()中将其注释掉,即:
apt-get update
# `
echo "please select the Version of blah you want ************ 1)blah1 2)blah2 3)blah3 4)All (1,2,3) 5)I will do this manualy (in the software center)"
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句