|
From: | p sena |
Subject: | Re: how to run remote bash scripts with "|", "-" characters in it |
Date: | Fri, 11 Oct 2013 12:10:54 -0700 (PDT) |
Hi,I have a minimal bash executable script to be run across N hosts. I do it this waycat hosts.txt |parallel -j 0 -u rsync -Ha /home/user/dirname/hello {}:/home/user/hello \; ssh {} /home/user/hellohello is a bash script with executable perms for all. The script looks like below-#!/bin/bash
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
done;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~Ciao.
[Prev in Thread] | Current Thread | [Next in Thread] |