<<<是什么?以bash表示的平均值(即,在socat ...<<<""字符串>>输出文件名中) [英] What does <<< mean in bash (ie. in socat ... <<<"string" >output-filename)

查看:108
本文介绍了<<<是什么?以bash表示的平均值(即,在socat ...<<<""字符串>>输出文件名中)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图理解一个代码库,在其中看到如下所示的行: socat /tmp/haproxy - <<< "show servers state" > /var/state/haproxy/global

socat在这里做什么? <<<是什么意思?

解决方案

socat命令在文件/tmp/haproxystdin之间创建双向管道,该管道通过将-传递给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.

这篇关于&lt;&lt;&lt;是什么?以bash表示的平均值(即,在socat ...&lt;&lt;&lt;&quot;&quot;字符串&gt;&gt;输出文件名中)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆