【问题标题】:piping the output into a shell script | Amazon Linux管道输出到一个shell脚本|亚马逊 Linux
【发布时间】:2016-01-17 23:48:40
【问题描述】:

我有一个案例,我需要在操作系统 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 脚本。请帮忙。

【问题讨论】:

    标签: linux shell amazon


    【解决方案1】:

    您可能没有在脚本上设置可执行位。请尝试chmod a+x watch.sh,然后重试。

    【讨论】:

    • 或者只做sh ./watch.sh。无需修改权限。
    猜你喜欢
    • 1970-01-01
    • 2015-02-17
    • 2018-11-13
    • 2013-11-07
    • 2016-03-11
    • 1970-01-01
    • 2012-08-29
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多