系统相关
首页 > 系统相关> > shell operator EOF shell 操作符

shell operator EOF shell 操作符

作者:互联网

 

总结:

这些被叫做shell操作符 shell operator

 

主要分为 control operators和redirection operators

 

 

 

 

 

 

 

 

 <<: 这个被称作here document, 通常用来打印多行string

 

command会接收任何东西直到它找到下一个WORD,也就是上面的Text,

通常WORD一般用EOF,还可以是数字, 如果WORD被引号了,里面的内容不会有变量展,,如果没有被引号,那么变量会被站看

 

 

如果你想把command << WORD ... WORD 的结果继续向后导入,你必须把pipe放在<< WORD的同一行,你不能放在 第二个WORD或者别的行上

 

 

<<<被成为 here string,类似于here documents,但被放在single line上使用,这个只存在于Unix port or rc(它起源的地方),zsh 一些ksh yash和bash上

无论什么东西给WORD都会被站看,并且值会传给command,这个一般用将变量传给一个command

 

 

 

 

 

 

 

 

 

 

原文:

https://unix.stackexchange.com/questions/159513/what-are-the-shells-control-and-redirection-operators

 

标签:control,shell,WORD,EOF,operators,command,operator
来源: https://www.cnblogs.com/eret9616/p/14630435.html