[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Prefix each line with "input line"
From: |
Hans Schou |
Subject: |
Re: Prefix each line with "input line" |
Date: |
Mon, 3 Oct 2011 01:06:22 +0200 (CEST) |
User-agent: |
Alpine 2.02 (DEB 1266 2009-07-14) |
On Mon, 3 Oct 2011, Ole Tange wrote:
On Sun, Oct 2, 2011 at 12:15 PM, Hans Schou <chlor@schou.dk> wrote:
Hi
I have a number of servers and sometimes I want to check a setting on all of
them. Like "what is the default search domain".
For convenience I have all the server names in the environment:
export srv_all="example.org example.com"
(could be in a file, but environment is always at hand)
Then I get the answer by running:
parallel ssh {} "grep search /etc/resolv.conf" ::: $srv_all
and the output:
search example.org
search example.xxx
The idea of --onall/--nonall is to never write 'parallel ssh {}'.
Instead you will keep the list of servers in .profile/sshloginfile or
you will use -S to select a different file or --profile to select a
different profile.
Please test --tag (from git version beef9c1) and see if that solves your issue:
parallel -S .. --tag --nonall run this
Well, it works, but I had one server down sp it took quite a time
before I got the first answer:
$ parallel -S .. --tag --nonall grep search /etc/resolv.conf
min ssh: connect to host min port 22: No route to host
sko search example.org
far search example.org
parallel -S .. --tag --onall run this ::: with these args
??? Why would I have args? Like this?:
$ parallel -S .. --tag --onall ::: date uptime
Use of uninitialized value $a in substitution (s///) at
/usr/local/bin/parallel line 862, <$fh> line 2.
Use of uninitialized value $a in substitution (s///) at
/usr/local/bin/parallel line 863, <$fh> line 2.
Use of uninitialized value in concatenation (.) or string at
/usr/local/bin/parallel line 104, <$fh> line 2.
min ssh: connect to host min port 22: No route to host
min ssh: connect to host min port 22: No route to host
sko man okt 3 01:03:18 CEST 2011
sko 01:03:18 up 1 day, 16:53, 6 users, load average: 0.00,
0.09, 0.13
far Mon Oct 3 01:03:17 CEST 2011
far 01:03:18 up 83 days, 4:18, 1 user, load average: 0.00,
0.02, 0.00
...and I think there was a bug:
$ parallel --version
GNU parallel 20111002
/hans
--
Horsebakken 78, DK-2400 København NV