将输出管道化为shell脚本|亚马逊Linux

时间:2015-10-19 14:56:53

标签: linux shell amazon

我有一个案例,我需要在操作系统Amazon Linux中使用命令启动shell脚本。 以下是我通过的命令

[premkumar@rails-app-5 ~]$ sudo rds-watch-db-logfile fdstaging --log-file-name slowquery/mysql-slowquery.log | ./watch.sh

以下是回复..

-bash: ./watch.sh: Permission denied

Watch.sh

#! /bin/bash
URL="https://collectors.sumologic.com/receiver/v1/http/<unique URL string>"
while read data;
do
        curl --data "$data" $URL
done

- 结束

参考链接为https://www.sumologic.com/2014/07/28/pushing-aws-rds-logs-to-sumo-logic/

任何人都可以帮助我吗?我需要使用该命令运行此shell脚本。请帮助。

1 个答案:

答案 0 :(得分:1)

您可能无法在脚本上设置可执行位。试试chmod a+x watch.sh然后重试。