Altiscale / pdsh

Automatically exported from code.google.com/p/pdsh
GNU General Public License v2.0
0 stars 0 forks source link

Document running commands inside a shell with exec module #38

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

Is there any trick to make work next sentence ?

pdsh -Rexec -w ^hosts.txt "command1 | command2"

Can we use pipe inside the command with exec module, like we do in ssh module ?

I tried some variants (escapping "|", ...), but I didn't get the correct 
formula to do it works

Thank you!

Original issue reported on code.google.com by javibarr...@gmail.com on 14 Sep 2011 at 1:47

GoogleCodeExporter commented 9 years ago
The exec modules runs exec() and not a shell, so pipe won't work directly in the
command line as above. However, you can get all the power of the shell by just 
invoking your command under a shell, e.g.:

 pdsh -Rexec -w ^hosts.txt bash -c "cmd1 | cmd2"

If that doesn't work for some reason, just update this bug.

Original comment by mark.gro...@gmail.com on 14 Sep 2011 at 1:53

GoogleCodeExporter commented 9 years ago
Ok!, It did the work, I didn't remember I was used that trick in find exec 
command before!

I would add an example of this in manpage, there are other people that got 
confused by this issue [1]

Thank you again!

[1] http://code.google.com/p/ssssh/wiki/Details

Original comment by javibarr...@gmail.com on 14 Sep 2011 at 2:13

GoogleCodeExporter commented 9 years ago
Thanks, that is a good suggestion!
Changing this issue to a documentation enhancement request

Original comment by mark.gro...@gmail.com on 14 Sep 2011 at 5:03