-bash:意外标记“换行符”附近的语法错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5134399/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 20:14:12  来源:igfitidea点击:

-bash: syntax error near unexpected token `newline'

bashsyntaxnewlinetoken

提问by Jonathan.V

To reset the admin password of SolusVM I am executing the following command:

要重置 SolusVM 的管理员密码,我正在执行以下命令

php /usr/local/solusvm/scripts/pass.php --type=admin --comm=change --username=<ADMINUSERNAME>

When doing so, the following error message is printed:

这样做时,会打印以下错误消息:

-bash: syntax error near unexpected token `newline'

What is the reason for this problem? I am running the command as root.

这个问题的原因是什么?我以 root 身份运行命令。

回答by Terence Simpson

The characters '<', and '>', are to indicate a place-holder, you should remove them to read:

字符 '<' 和 '>' 表示占位符,您应该删除它们以阅读:

php /usr/local/solusvm/scripts/pass.php --type=admin --comm=change --username=ADMINUSERNAME