简体   繁体   English

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

[英]-bash: syntax error near unexpected token `newline' for display command

I want to open a gif file using linux command.The file's name is "Simulation of electrical activity in the heart during fibrillation (with comparison with experiment).gif".我想用linux命令打开一个gif文件。文件名是“颤动期间心脏电活动的模拟(与实验比较).gif”。

I use the following command:我使用以下命令:

$display <Simulation of electrical activity in the heart during fibrillation\(\with comparison with experiment\)\.gif>

It gives me它给了我

-bash: syntax error near unexpected token `newline'

What's wrong with it?它出什么问题了? Thank you!谢谢!

The reason原因

display <filename>

gives you a syntax error near unexpected token newline is that the arrow brackets in whatever documentation you were following were not intended to be taken literally. syntax error near unexpected token newline给你一个syntax error near unexpected token newline是你所遵循的任何文档中的箭头括号都不是按字面意思理解的。

A < indicates that the thing that follows is a filename to be used as input on stdin, and a > indicates that the thing that follows is a filename to be used for output on stdout; <表示后面的东西是要在 stdin 上用作输入的文件名,而>表示后面的东西是要用于 stdout 输出的文件名; thus, a > at the very end of your command is a syntax error, because it expects a file name to follow, not a newline.因此,命令末尾的>是一个语法错误,因为它需要一个文件名,而不是一个换行符。

Rather, use:而是使用:

display filename

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM