Thanks. I think the normal script without those escapes will only work. No need to quote things in the script for parallel. Quotes would have been required if the script is supplied as a command line itself. Otherwise script written in normal manner will suffice.
~Ciao. On Saturday, October 12, 2013 12:31 AM, Hans Schou <[email protected]> wrote: Explamation point is a problem. WRONG: echo "Hello, world!" RIGHT: echo "Hello, world"\! OR: echo Hello, world\! Will this work? #! /bin/bash cd /dir/logs/pot1/jagger for f in logs-2013-10-09-*.gz; do echo Hello World "| Hi Hell"\!\!" , | , |" zcat $f | /bin/egrep 'TIMEOUT|error' | /bin/egrep GSMTable done 2013/10/11 p sena <[email protected]> Hi, > > >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- > >#!/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.
