<?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: Bash While Loop Example</title> <atom:link href="http://www.cyberciti.biz/faq/bash-while-loop/feed/" rel="self" type="application/rss+xml" /><link>http://www.cyberciti.biz/faq/bash-while-loop/</link> <description>Every answer asks a more beautiful question.</description> <lastBuildDate>Fri, 10 Feb 2012 11:20:49 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>By: vaishali</title><link>http://www.cyberciti.biz/faq/bash-while-loop/#comment-61829</link> <dc:creator>vaishali</dc:creator> <pubDate>Wed, 24 Aug 2011 04:59:22 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/bash-while-loop/#comment-61829</guid> <description>how to write a program in bash for displaying table using until statement? table should be like
1 2 3 4
2 4 6 8
3 6 9 12
4 8 12 16
plz reply soon....thanks</description> <content:encoded><![CDATA[<p>how to write a program in bash for displaying table using until statement? table should be like<br
/> 1 2 3 4<br
/> 2 4 6 8<br
/> 3 6 9 12<br
/> 4 8 12 16<br
/> plz reply soon&#8230;.thanks</p> ]]></content:encoded> </item> <item><title>By: Georg</title><link>http://www.cyberciti.biz/faq/bash-while-loop/#comment-54906</link> <dc:creator>Georg</dc:creator> <pubDate>Sat, 15 Jan 2011 13:38:51 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/bash-while-loop/#comment-54906</guid> <description>The script &quot;test&quot; should set variable &quot;filter_mode&quot; to FALSE if there are no lines in the file &quot;switches&quot; and to TRUE if there exists at least one line in the file &quot;switches&quot;.
Why do I get &quot;filter_mode : FALSE&quot; eventually?
gg@GeorgSimon:~$ cat test
#!/bin/bash
filter_mode=FALSE
cat ./switches &#124; while read switch ; do
echo switch : $switch
filter_mode=TRUE
echo filter_mode : $filter_mode
break
done
echo filter_mode : $filter_mode
gg@GeorgSimon:~$ cat switches
switch
gg@GeorgSimon:~$ sh test
switch : switch
filter_mode : TRUE
filter_mode : FALSE</description> <content:encoded><![CDATA[<p>The script &#8220;test&#8221; should set variable &#8220;filter_mode&#8221; to FALSE if there are no lines in the file &#8220;switches&#8221; and to TRUE if there exists at least one line in the file &#8220;switches&#8221;.<br
/> Why do I get &#8220;filter_mode : FALSE&#8221; eventually?</p><p>gg@GeorgSimon:~$ cat test<br
/> #!/bin/bash</p><p>filter_mode=FALSE<br
/> cat ./switches | while read switch ; do<br
/> echo switch : $switch<br
/> filter_mode=TRUE<br
/> echo filter_mode : $filter_mode<br
/> break<br
/> done<br
/> echo filter_mode : $filter_mode<br
/> gg@GeorgSimon:~$ cat switches<br
/> switch<br
/> gg@GeorgSimon:~$ sh test<br
/> switch : switch<br
/> filter_mode : TRUE<br
/> filter_mode : FALSE</p> ]]></content:encoded> </item> <item><title>By: Vivek Gite</title><link>http://www.cyberciti.biz/faq/bash-while-loop/#comment-51097</link> <dc:creator>Vivek Gite</dc:creator> <pubDate>Wed, 24 Nov 2010 12:00:19 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/bash-while-loop/#comment-51097</guid> <description>&lt;pre&gt;#!/bin/bash
i=1
y=1
while [ $i -le 5 ]
do
while [ $y -le 10 ]
do
echo &quot;$y * $i = $(( $y * $i ))&quot;
(( y++ ))
done
y=1
(( i++ ))
done&lt;/pre&gt; </description> <content:encoded><![CDATA[<pre>#!/bin/bash
i=1
y=1
while [ $i -le 5 ]
do
	while [ $y -le 10 ]
	do
		echo "$y * $i = $(( $y * $i ))"
		(( y++ ))
	done
	y=1
	(( i++ ))
done</pre>]]></content:encoded> </item> <item><title>By: Elaine</title><link>http://www.cyberciti.biz/faq/bash-while-loop/#comment-51096</link> <dc:creator>Elaine</dc:creator> <pubDate>Wed, 24 Nov 2010 11:19:08 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/bash-while-loop/#comment-51096</guid> <description>does anyone can give an example of a while loop within a loop?</description> <content:encoded><![CDATA[<p>does anyone can give an example of a while loop within a loop?</p> ]]></content:encoded> </item> <item><title>By: san</title><link>http://www.cyberciti.biz/faq/bash-while-loop/#comment-49905</link> <dc:creator>san</dc:creator> <pubDate>Mon, 04 Oct 2010 12:32:07 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/bash-while-loop/#comment-49905</guid> <description>shift command
to traverse through arguments
x=1
while [ $x -le 3 ]
do
echo  &quot;argument is :$1&quot;
shift
x=`expr $x + 1`
done</description> <content:encoded><![CDATA[<p>shift command<br
/> to traverse through arguments<br
/> x=1<br
/> while [ $x -le 3 ]<br
/> do<br
/> echo  &#8220;argument is :$1&#8243;<br
/> shift<br
/> x=`expr $x + 1`<br
/> done</p> ]]></content:encoded> </item> <item><title>By: pritam singh</title><link>http://www.cyberciti.biz/faq/bash-while-loop/#comment-48663</link> <dc:creator>pritam singh</dc:creator> <pubDate>Fri, 06 Aug 2010 08:07:44 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/bash-while-loop/#comment-48663</guid> <description>Thank you so much .
you define very nicly all exampls regarding while loop secquence
statement....</description> <content:encoded><![CDATA[<p>Thank you so much .<br
/> you define very nicly all exampls regarding while loop secquence<br
/> statement&#8230;.</p> ]]></content:encoded> </item> <item><title>By: Nikki</title><link>http://www.cyberciti.biz/faq/bash-while-loop/#comment-48431</link> <dc:creator>Nikki</dc:creator> <pubDate>Tue, 20 Jul 2010 16:32:56 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/bash-while-loop/#comment-48431</guid> <description>Does anyone know how to write a script that echoes three different arguments three times using a loop</description> <content:encoded><![CDATA[<p>Does anyone know how to write a script that echoes three different arguments three times using a loop</p> ]]></content:encoded> </item> <item><title>By: pranathy</title><link>http://www.cyberciti.biz/faq/bash-while-loop/#comment-44435</link> <dc:creator>pranathy</dc:creator> <pubDate>Wed, 04 Nov 2009 05:58:05 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/bash-while-loop/#comment-44435</guid> <description>could u please give the shell script for printing the fibonocci series and to know if the number is palindrome and also if it an armstrong number</description> <content:encoded><![CDATA[<p>could u please give the shell script for printing the fibonocci series and to know if the number is palindrome and also if it an armstrong number</p> ]]></content:encoded> </item> <item><title>By: Cobra</title><link>http://www.cyberciti.biz/faq/bash-while-loop/#comment-44353</link> <dc:creator>Cobra</dc:creator> <pubDate>Wed, 28 Oct 2009 07:38:38 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/bash-while-loop/#comment-44353</guid> <description>Very useful examples, thank you!</description> <content:encoded><![CDATA[<p>Very useful examples, thank you!</p> ]]></content:encoded> </item> <item><title>By: vivek</title><link>http://www.cyberciti.biz/faq/bash-while-loop/#comment-37659</link> <dc:creator>vivek</dc:creator> <pubDate>Tue, 18 Mar 2008 10:22:59 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/bash-while-loop/#comment-37659</guid> <description>Yes there is a break and continue statement. man bash has more information.</description> <content:encoded><![CDATA[<p>Yes there is a break and continue statement. man bash has more information.</p> ]]></content:encoded> </item> <item><title>By: Leslie Satenstein</title><link>http://www.cyberciti.biz/faq/bash-while-loop/#comment-37643</link> <dc:creator>Leslie Satenstein</dc:creator> <pubDate>Sun, 16 Mar 2008 01:02:32 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/bash-while-loop/#comment-37643</guid> <description>Nice to see the Bash shell,
How do you break out of a loop
is there a break statement, or do you have to use a goto?</description> <content:encoded><![CDATA[<p>Nice to see the Bash shell,<br
/> How do you break out of a loop</p><p>is there a break statement, or do you have to use a goto?</p> ]]></content:encoded> </item> </channel> </rss>
