简体   繁体   English

“ |是什么? bash”在OS X终端上的curl调用末尾

[英]What does “ | bash” at the end of curl call in terminal on os x mean

In a tutorial on how to set up virtual box i came across the following line 在有关如何设置虚拟盒子的教程中,我遇到了以下一行

curl -s https://raw.github.com/xdissent/ievms/master/ievms.sh | bash

I got curious on what the "| bash" part means, but i can't find it on google and its driving me nuts. 我对“ | bash”部分的含义感到好奇,但我在Google上找不到它,这让我发疯。 Most likely this is a very n00b question, but I would appreciate if someone could give me an explanation. 这很可能是一个非常n00b的问题,但是如果有人可以给我一个解释,我将不胜感激。

The | | or pipe operator will redirect the output of the previous command ( curl in this case) to bash , ie the shell. 或管道运算符会将前一个命令的输出(在这种情况下为curl )重定向到bash (即shell)。 bash itself will execute it. bash本身将执行它。

So whatever the website returns will be executed as a shell script. 因此,无论网站返回什么内容,都将作为Shell脚本执行。

This is nowadays typical for installers, but you should be aware of the source (website) and content the URL provides, because it may harm your system. 对于当今的安装人员来说,这是很典型的做法,但是您应该注意URL提供的源(网站)和内容,因为它可能会损害您的系统。

More on the pipeline: http://www.gnu.org/software/bash/manual/html_node/Pipelines.html 即将发布的更多信息: http : //www.gnu.org/software/bash/manual/html_node/Pipelines.html

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

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