【发布时间】:2015-09-13 15:49:19
【问题描述】:
我正在尝试在引号内的 bash 中使用 echo。 当我从命令行尝试时,它工作正常。
例如:echo "I'm testing the apostrophe functionality."
产生I'm testing the apostrophe functionality.
然而,当我在脚本中写这个时,它似乎不起作用。
这是我的代码的 sn-p:(我正在尝试将 ASCII 艺术集成到我的程序中)
if [ "$2" == "-s" ]
then echo " ___ __ _ _ "
echo " / _ \__ _ _ __ ___ ___ / _\ |_ __ _ _ __| |_ ___ _ __ "
echo " / /_\/ _` | '_ ` _ \ / _ \_____\ \| __/ _` | '__| __/ _ \ '__|"
echo "/ /_\\ (_| | | | | | | __/_____|\ \ || (_| | | | || __/ | "
echo "\____/\__,_|_| |_| |_|\___| \__/\__\__,_|_| \__\___|_| "
echo ""
echo "Hello! My name is Siri."
echo "I'm not actually the Siri you're probably used to."
echo "I'm actually Apple's Siri's sister, the no-voice one."
echo "Sorry, but I'm in development right now."
echo "Come back later and maybe Eric will bring me out of beta."
echo "Thanks for reading this long debug message!"
fi
我已经检查并仔细检查了我所有的报价......
但它仍然产生:
./game-starter.sh: line 7: unexpected EOF while looking for matching ``'
./game-starter.sh: line 88: syntax error: unexpected end of file
请尽快帮忙!
-HewwoCraziness
【问题讨论】:
标签: bash escaping echo apostrophe