[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Working directories on remote machines
From: |
Hans Schou |
Subject: |
Re: Working directories on remote machines |
Date: |
Wed, 12 Oct 2011 19:09:10 +0200 (CEST) |
User-agent: |
Alpine 2.02 (DEB 1266 2009-07-14) |
On Tue, 11 Oct 2011, Srikanth R Madikeri wrote:
Hello everyone,
I have been using gnu parallel to distribute tasks over
a host and a remote machine. Unfortunately, I am unable
to use more than one remote machine because the directory
structure in each of them is different. Is there a way to
mention the working directory for each remote system
individually (like comma separated list)?
Or tabulator or space:
$ echo -e "foo.example.com\t/home/joe" > mylist
$ echo -e "bar.example.com\t/home/jane" >> mylist
$ parallel --colsep '\t' echo "Server: {1} Path: {2}" < mylist
Server: foo.example.com Path: /home/joe
Server: bar.example.com Path: /home/jane
This might be what you really want:
$ parallel --colsep '\t' echo "ssh {1} ls {2}" < mylist
ssh foo.example.com ls /home/joe
ssh bar.example.com ls /home/jane
...without the echo
And BTW, this is the same:
parallel --colsep '\t' echo "ssh {1} ls {2}" :::: mylist
/hans
--
Horsebakken 78, DK-2400 København NV