[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

how to run remote bash scripts with "|", "-" characters in it

From: p sena
Subject: how to run remote bash scripts with "|", "-" characters in it
Date: Fri, 11 Oct 2013 10:59:18 -0700 (PDT)


I have a minimal bash executable script to be run across N hosts. I do it this way

cat hosts.txt |parallel -j 0 -u rsync -Ha /home/user/dirname/hello {}:/home/user/hello \; ssh {} /home/user/hello

hello is a bash script with executable perms for all. The script looks like below-

cd /dir/logs/pot1/jagger
for f in `ls logs-2013-10-09-*.gz`; do
    echo Hello World "|  Hi Hell!! , | , |"
    zcat $f |/bin/grep \\-E 'TIMEOUT|error' |/bin/grep \\-E GSMTable

However I am facing issues from using the pipe symbol (|) in the script. It is not outputtting the expected result; when I run and see on a single host too. How do I make use of pipes (|) within such scripts to be run remotely ? If I put a simple script with "echo hello world" in it only then it works fine. The issue crops up when I make it little complex like making use of "|" and/or "-" or "--" characters in the script. The "-" and "--" are options used with some command line programs.
Thanks in advance

reply via email to

[Prev in Thread] Current Thread [Next in Thread]