<?xml version="1.0" encoding="UTF-8"?><rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
> <channel><title>Comments on: Execute Commands on Multiple Linux or UNIX Servers</title> <atom:link href="http://www.cyberciti.biz/tips/execute-commands-on-multiple-linux-or-unix-servers.html/feed" rel="self" type="application/rss+xml" /><link>http://www.cyberciti.biz/tips/execute-commands-on-multiple-linux-or-unix-servers.html</link> <description>This is a Linux sys admin journal by Vivek about sys admin work, Linux tips &#38; tricks, hacks, news and more.</description> <lastBuildDate>Fri, 10 Feb 2012 20:37:43 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>By: tepisi</title><link>http://www.cyberciti.biz/tips/execute-commands-on-multiple-linux-or-unix-servers.html#comment-165319</link> <dc:creator>tepisi</dc:creator> <pubDate>Thu, 23 Dec 2010 12:14:48 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/execute-commands-on-multiple-linux-or-unix-servers.html#comment-165319</guid> <description>But, how to execute remote self made shell script via ssh?</description> <content:encoded><![CDATA[<p>But, how to execute remote self made shell script via ssh?</p> ]]></content:encoded> </item> <item><title>By: Jidnesh I. Bhogare</title><link>http://www.cyberciti.biz/tips/execute-commands-on-multiple-linux-or-unix-servers.html#comment-152867</link> <dc:creator>Jidnesh I. Bhogare</dc:creator> <pubDate>Tue, 12 Jan 2010 06:43:03 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/execute-commands-on-multiple-linux-or-unix-servers.html#comment-152867</guid> <description>Hi, the script is really help ful!! Thanks for this. I want to add one small things for the administrators / developers who want to execute a command only on the remote machine via ssh + shell script e.g ssh test@192.168.0.2 &#039;service httpd status&#039; ....if some one want to change the single quoted parameter...he has to defined that much variable and called each variable one by one as per his desire to form expected command...check this code
&lt;pre&gt;#!/bin/sh
INPUT=&quot;service&quot;
I2=$1
#I2=&quot;httpd&quot;
I3=$2
#I3=&quot;stop&quot;
for I in $INPUT
do
echo -e &quot;----------------------------------------------\n&quot;;
for ip1 in $I2
do
for ip2 in $I3
do
ssh root@192.168.0.2 $I $ip1 $ip2
done
done
echo -e &quot;----------------------------------------------\n&quot;;
done&lt;/pre&gt;</description> <content:encoded><![CDATA[<p>Hi, the script is really help ful!! Thanks for this. I want to add one small things for the administrators / developers who want to execute a command only on the remote machine via ssh + shell script e.g ssh <a
href="mailto:test@192.168">test@192.168</a>.0.2 &#8216;service httpd status&#8217; &#8230;.if some one want to change the single quoted parameter&#8230;he has to defined that much variable and called each variable one by one as per his desire to form expected command&#8230;check this code</p><pre>#!/bin/sh
INPUT="service"
I2=$1
#I2="httpd"
I3=$2
#I3="stop"
for I in $INPUT
do
echo -e "----------------------------------------------\n";
for ip1 in $I2
do
for ip2 in $I3
do
ssh <a href="mailto:root@192.168">root@192.168</a>.0.2 $I $ip1 $ip2
done
done
echo -e "----------------------------------------------\n";
done</pre>]]></content:encoded> </item> <item><title>By: Nitn G</title><link>http://www.cyberciti.biz/tips/execute-commands-on-multiple-linux-or-unix-servers.html#comment-150998</link> <dc:creator>Nitn G</dc:creator> <pubDate>Fri, 09 Oct 2009 17:30:32 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/execute-commands-on-multiple-linux-or-unix-servers.html#comment-150998</guid> <description>i tested this script found not working when one of host is down ssh command does not proceed to next host
please help
Nitin</description> <content:encoded><![CDATA[<p>i tested this script found not working when one of host is down ssh command does not proceed to next host</p><p>please help</p><p>Nitin</p> ]]></content:encoded> </item> <item><title>By: Boby Thomas</title><link>http://www.cyberciti.biz/tips/execute-commands-on-multiple-linux-or-unix-servers.html#comment-147818</link> <dc:creator>Boby Thomas</dc:creator> <pubDate>Tue, 24 Mar 2009 10:49:57 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/execute-commands-on-multiple-linux-or-unix-servers.html#comment-147818</guid> <description>Nice script....thanks</description> <content:encoded><![CDATA[<p>Nice script&#8230;.thanks</p> ]]></content:encoded> </item> <item><title>By: Albert</title><link>http://www.cyberciti.biz/tips/execute-commands-on-multiple-linux-or-unix-servers.html#comment-146500</link> <dc:creator>Albert</dc:creator> <pubDate>Tue, 30 Dec 2008 19:47:28 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/execute-commands-on-multiple-linux-or-unix-servers.html#comment-146500</guid> <description>Great script, easy to use and understand. Thanks.</description> <content:encoded><![CDATA[<p>Great script, easy to use and understand. Thanks.</p> ]]></content:encoded> </item> <item><title>By: nfo</title><link>http://www.cyberciti.biz/tips/execute-commands-on-multiple-linux-or-unix-servers.html#comment-144904</link> <dc:creator>nfo</dc:creator> <pubDate>Wed, 10 Sep 2008 08:14:05 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/execute-commands-on-multiple-linux-or-unix-servers.html#comment-144904</guid> <description>Hi, nice script, simple and functionally!
another simialar solution is http://freshmeat.net/projects/dsh/
dsh can start a command parallel and serial, witch is a small advantage, but never mind.
best regards
andreas</description> <content:encoded><![CDATA[<p>Hi, nice script, simple and functionally!<br
/> another simialar solution is <a
href="http://freshmeat.net/projects/dsh/" rel="nofollow">http://freshmeat.net/projects/dsh/</a><br
/> dsh can start a command parallel and serial, witch is a small advantage, but never mind.</p><p>best regards<br
/> andreas</p> ]]></content:encoded> </item> <item><title>By: WikiGeeiki</title><link>http://www.cyberciti.biz/tips/execute-commands-on-multiple-linux-or-unix-servers.html#comment-45560</link> <dc:creator>WikiGeeiki</dc:creator> <pubDate>Sat, 23 Dec 2006 23:29:00 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/execute-commands-on-multiple-linux-or-unix-servers.html#comment-45560</guid> <description>Excellent article! Thank you.</description> <content:encoded><![CDATA[<p>Excellent article! Thank you.</p> ]]></content:encoded> </item> <item><title>By: Anonymous</title><link>http://www.cyberciti.biz/tips/execute-commands-on-multiple-linux-or-unix-servers.html#comment-19382</link> <dc:creator>Anonymous</dc:creator> <pubDate>Wed, 28 Dec 2005 20:55:00 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/execute-commands-on-multiple-linux-or-unix-servers.html#comment-19382</guid> <description>Very nice script. I use(d?) to manually write a &quot;for&quot; loop every time I need to run the same command on multiple hosts.
I&#039;ve just modified your sample script, declaring another variable (COMMAND=$@) to use instead of &quot;w&quot;, so I can run
&lt;B&gt;./dsh cat /etc/hosts&lt;/B&gt; to get the content of all servers&#039; /etc/hosts in my mailbox.</description> <content:encoded><![CDATA[<p>Very nice script. I use(d?) to manually write a &#8220;for&#8221; loop every time I need to run the same command on multiple hosts.<br
/> I&#8217;ve just modified your sample script, declaring another variable (COMMAND=$@) to use instead of &#8220;w&#8221;, so I can run<br
/> <b>./dsh cat /etc/hosts</b> to get the content of all servers&#8217; /etc/hosts in my mailbox.</p> ]]></content:encoded> </item> <item><title>By: Michael</title><link>http://www.cyberciti.biz/tips/execute-commands-on-multiple-linux-or-unix-servers.html#comment-19381</link> <dc:creator>Michael</dc:creator> <pubDate>Wed, 28 Dec 2005 20:31:00 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/execute-commands-on-multiple-linux-or-unix-servers.html#comment-19381</guid> <description>If you want to fully parallelize the script you can wrap the ssh command in parentheses in order to execute in a subshell, I believe. That way the script doesn&#039;t wait for the program to finish. I use this to dynamically test all the workstations in my lab (~150) to see which ones are up and running, so I can generate a machine list for a distributed MPICH program.</description> <content:encoded><![CDATA[<p>If you want to fully parallelize the script you can wrap the ssh command in parentheses in order to execute in a subshell, I believe. That way the script doesn&#8217;t wait for the program to finish. I use this to dynamically test all the workstations in my lab (~150) to see which ones are up and running, so I can generate a machine list for a distributed MPICH program.</p> ]]></content:encoded> </item> <item><title>By: Anonymous</title><link>http://www.cyberciti.biz/tips/execute-commands-on-multiple-linux-or-unix-servers.html#comment-19380</link> <dc:creator>Anonymous</dc:creator> <pubDate>Wed, 28 Dec 2005 19:15:00 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/execute-commands-on-multiple-linux-or-unix-servers.html#comment-19380</guid> <description>Why not use dsh:
http://www.netfort.gr.jp/~dancer/software/dsh.html</description> <content:encoded><![CDATA[<p>Why not use dsh:<br
/> <a
href="http://www.netfort.gr.jp/~dancer/software/dsh.html" rel="nofollow">http://www.netfort.gr.jp/~dancer/software/dsh.html</a></p> ]]></content:encoded> </item> </channel> </rss>
