<<<是什么?以bash表示的平均值(即,在socat ...<<<""字符串>>输出文件名中) [英] What does <<< mean in bash (ie. in socat ... <<<"string" >output-filename)
问题描述
我试图理解一个代码库,在其中看到如下所示的行:
socat /tmp/haproxy - <<< "show servers state" > /var/state/haproxy/global
socat在这里做什么? <<<
是什么意思?
socat
命令在文件/tmp/haproxy
和stdin
之间创建双向管道,该管道通过将-
传递给socat
来表示./p>
实际上,它将stdin附加到/tmp/haproxy
并将结果输出写入/var/state/haproxy/global
<<<
是一项bash功能,即所谓的 此处为字符串 .它将字符串"show server state"作为标准输入传递给socat
.
I am trying to understand a codebase where I see a line like below:
socat /tmp/haproxy - <<< "show servers state" > /var/state/haproxy/global
What is socat doing here? What does <<<
mean?
The socat
command creates a bidirectional pipe between the file /tmp/haproxy
and stdin
which is expressed by passing -
to socat
.
In fact it appends stdin to /tmp/haproxy
and writes the resulting output to /var/state/haproxy/global
<<<
is a bash feature, a so called here string. It passes the string "show server state" as stdin to socat
.
这篇关于<<<是什么?以bash表示的平均值(即,在socat ...<<<""字符串>>输出文件名中)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!