为什么不能将tail -f插入我的shell脚本中?

时间:2018-08-24 10:05:28

标签: shell curl

当前,我有一个脚本(log.sh),可以将内容按如下方式通过管道传输到日志记录服务器的REST API

curl -H "content-type:text/plain" -d $1 http://my-logging-server.com/api

运行./log.sh“ Hello world”有效

但是当我尝试进行实时跟踪并将结果通过管道传递到我的shell脚本中时:

tail -f live.log | ./log.sh

我得到:

curl: no URL specified!

为什么不能卷曲识别URL?

0 个答案:

没有答案