shell operator EOF shell 操作符 << <<<

 

总结:

这些被叫做shell操作符 shell operator

 

主要分为 control operators和redirection operators

shell operator EOF shell 操作符 << <<<

 

 

 

 

shell operator EOF shell 操作符 << <<<

 

 

 

shell operator EOF shell 操作符 << <<<

 

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

 

command会接收任何东西直到它找到下一个WORD(标记),Text是输入给command的内容

通常WORD一般用EOF,还可以是其他你喜欢的字母string, 如果WORD被引号了,里面的内容不会有变量展开,如果没有被引号,那么变量会被展开

 

 

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

 

shell operator EOF shell 操作符 << <<<

 

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

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

shell operator EOF shell 操作符 << <<<

 

 

 

 

 

 

 

 

 

 

原文:

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

 

相关文章:

  • 2021-08-30
  • 2022-12-23
  • 2021-05-31
  • 2021-06-29
  • 2022-01-20
  • 2021-08-11
  • 2021-08-26
猜你喜欢
  • 2021-07-24
  • 2022-12-23
  • 2021-05-22
  • 2022-12-23
  • 2022-12-23
  • 2021-10-09
相关资源
相似解决方案