<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Linux Ask! &#187; Bash</title>
	<atom:link href="http://www.linuxask.com/topics/programming/bash/feed" rel="self" type="application/rss+xml" />
	<link>http://www.linuxask.com</link>
	<description>Linux Ask! is a Q &#38; A web site specific for Linux related questions such as how to use common Linux commands.</description>
	<lastBuildDate>Sat, 04 Feb 2012 05:57:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Check if a file exist in Bash Shell</title>
		<link>http://www.linuxask.com/questions/check-if-a-file-exist-in-bash-shell</link>
		<comments>http://www.linuxask.com/questions/check-if-a-file-exist-in-bash-shell#comments</comments>
		<pubDate>Tue, 23 Aug 2011 13:44:55 +0000</pubDate>
		<dc:creator>Linux Ask!</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://www.linuxask.com/?p=3405</guid>
		<description><![CDATA[Check if a file exist in Bash Shell Answer: The following script demonstrates how to check if a file exist, using shell (Bash) script #!/bin/bash if [ -e test.txt ] then echo 'The file exists.' else echo 'The file does not exist.' fi Related posts: How to check the bash shell version How to perform <a href='http://www.linuxask.com/questions/check-if-a-file-exist-in-bash-shell'>[...]</a>
Related posts:<ol>
<li><a href='http://www.linuxask.com/questions/how-to-check-the-bash-shell-version' rel='bookmark' title='How to check the bash shell version'>How to check the bash shell version</a></li>
<li><a href='http://www.linuxask.com/questions/how-to-perform-syntax-check-on-a-bash-script' rel='bookmark' title='How to perform syntax check on a bash script?'>How to perform syntax check on a bash script?</a></li>
<li><a href='http://www.linuxask.com/questions/how-to-get-the-pid-in-current-bash-shell-script' rel='bookmark' title='How to get the PID in current bash shell script'>How to get the PID in current bash shell script</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Check if a file exist in Bash Shell</p>
<p><strong>Answer:</strong></p>
<p>The following script demonstrates how to check if a file exist, using shell (<strong>Bash</strong>) script </p>
<pre><code>#!/bin/bash

if [ -e test.txt ]
then
  echo 'The file exists.'
else
  echo 'The file does not exist.'
fi
</code></pre>
<p>Related posts:<ol>
<li><a href='http://www.linuxask.com/questions/how-to-check-the-bash-shell-version' rel='bookmark' title='How to check the bash shell version'>How to check the bash shell version</a></li>
<li><a href='http://www.linuxask.com/questions/how-to-perform-syntax-check-on-a-bash-script' rel='bookmark' title='How to perform syntax check on a bash script?'>How to perform syntax check on a bash script?</a></li>
<li><a href='http://www.linuxask.com/questions/how-to-get-the-pid-in-current-bash-shell-script' rel='bookmark' title='How to get the PID in current bash shell script'>How to get the PID in current bash shell script</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.linuxask.com/questions/check-if-a-file-exist-in-bash-shell/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to echo string to standard error (stderr)?</title>
		<link>http://www.linuxask.com/questions/how-to-echo-string-to-standard-error-stderr</link>
		<comments>http://www.linuxask.com/questions/how-to-echo-string-to-standard-error-stderr#comments</comments>
		<pubDate>Fri, 03 Jun 2011 14:38:36 +0000</pubDate>
		<dc:creator>Linux Ask!</dc:creator>
				<category><![CDATA[Advanced Linux]]></category>
		<category><![CDATA[Bash]]></category>

		<guid isPermaLink="false">http://www.linuxask.com/?p=3068</guid>
		<description><![CDATA[How to echo string to standard error (stderr)? Answer: To echo string to the standard error (stderr), rather than the standard output (stdout), you can define the following function in your shell (put in your ~/.bashrc file) # function echo2() { echo "$@" 1>&#038;2; } Then you can execute the command like: # echo2 test <a href='http://www.linuxask.com/questions/how-to-echo-string-to-standard-error-stderr'>[...]</a>
Related posts:<ol>
<li><a href='http://www.linuxask.com/questions/how-to-redirect-error-message-to-a-file' rel='bookmark' title='How to redirect error message to a file'>How to redirect error message to a file</a></li>
<li><a href='http://www.linuxask.com/questions/save-program-output-and-error-to-different-files' rel='bookmark' title='Save program output and error to different files'>Save program output and error to different files</a></li>
<li><a href='http://www.linuxask.com/questions/printing-the-exclamation-mark-using-echo' rel='bookmark' title='Printing the exclamation mark using echo'>Printing the exclamation mark using echo</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>How to echo string to standard error (stderr)?</p>
<p><strong>Answer:</strong></p>
<p>To echo string to the <strong>standard error</strong> (stderr), rather than the <strong>standard output</strong> (stdout), you can define the following function in your shell (put in your  <strong>~/.bashrc</strong> file)</p>
<p><code># function echo2() { echo "$@" 1>&#038;2; }</code></p>
<p>Then you can execute the command like:</p>
<p><code># echo2 test</code></p>
<p>Related posts:<ol>
<li><a href='http://www.linuxask.com/questions/how-to-redirect-error-message-to-a-file' rel='bookmark' title='How to redirect error message to a file'>How to redirect error message to a file</a></li>
<li><a href='http://www.linuxask.com/questions/save-program-output-and-error-to-different-files' rel='bookmark' title='Save program output and error to different files'>Save program output and error to different files</a></li>
<li><a href='http://www.linuxask.com/questions/printing-the-exclamation-mark-using-echo' rel='bookmark' title='Printing the exclamation mark using echo'>Printing the exclamation mark using echo</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.linuxask.com/questions/how-to-echo-string-to-standard-error-stderr/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple for loop in Bash shell</title>
		<link>http://www.linuxask.com/questions/simple-for-loop-in-bash-shell</link>
		<comments>http://www.linuxask.com/questions/simple-for-loop-in-bash-shell#comments</comments>
		<pubDate>Wed, 01 Jun 2011 14:30:12 +0000</pubDate>
		<dc:creator>Linux Ask!</dc:creator>
				<category><![CDATA[Bash]]></category>

		<guid isPermaLink="false">http://www.linuxask.com/?p=3065</guid>
		<description><![CDATA[Simple for loop in Bash shell Answer: A simple for loop in Bash shell would like the following. You can use it wisely to skip a lot of repetitive tasks. #!/bin/bash for i in {1..10} do echo "I am command No. $i" done Related posts: How to get the PID in current bash shell script <a href='http://www.linuxask.com/questions/simple-for-loop-in-bash-shell'>[...]</a>
Related posts:<ol>
<li><a href='http://www.linuxask.com/questions/how-to-get-the-pid-in-current-bash-shell-script' rel='bookmark' title='How to get the PID in current bash shell script'>How to get the PID in current bash shell script</a></li>
<li><a href='http://www.linuxask.com/questions/check-if-a-file-exist-in-bash-shell' rel='bookmark' title='Check if a file exist in Bash Shell'>Check if a file exist in Bash Shell</a></li>
<li><a href='http://www.linuxask.com/questions/how-to-check-the-bash-shell-version' rel='bookmark' title='How to check the bash shell version'>How to check the bash shell version</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Simple for loop in Bash shell</p>
<p><strong>Answer:</strong></p>
<p>A simple for loop in <strong>Bash </strong>shell would like the following. You can use it wisely to skip a lot of repetitive tasks.</p>
<pre><code>#!/bin/bash

for i in {1..10}
do
   echo "I am command No. $i"
done
</code></pre>
<p>Related posts:<ol>
<li><a href='http://www.linuxask.com/questions/how-to-get-the-pid-in-current-bash-shell-script' rel='bookmark' title='How to get the PID in current bash shell script'>How to get the PID in current bash shell script</a></li>
<li><a href='http://www.linuxask.com/questions/check-if-a-file-exist-in-bash-shell' rel='bookmark' title='Check if a file exist in Bash Shell'>Check if a file exist in Bash Shell</a></li>
<li><a href='http://www.linuxask.com/questions/how-to-check-the-bash-shell-version' rel='bookmark' title='How to check the bash shell version'>How to check the bash shell version</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.linuxask.com/questions/simple-for-loop-in-bash-shell/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to echo a tab in bash?</title>
		<link>http://www.linuxask.com/questions/how-to-echo-a-tab-in-bash</link>
		<comments>http://www.linuxask.com/questions/how-to-echo-a-tab-in-bash#comments</comments>
		<pubDate>Sat, 23 Oct 2010 14:09:15 +0000</pubDate>
		<dc:creator>Linux Ask!</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Basic Linux]]></category>

		<guid isPermaLink="false">http://www.linuxask.com/?p=2472</guid>
		<description><![CDATA[How to echo a tab in bash? Answer: In Bash script, if you want to print out unprintable characters such as tab, you need to use -e flag together with the echo command. E.g. echo -e "\tfoo\tbar" Related posts: How to perform syntax check on a bash script? How to get the PID in current <a href='http://www.linuxask.com/questions/how-to-echo-a-tab-in-bash'>[...]</a>
Related posts:<ol>
<li><a href='http://www.linuxask.com/questions/how-to-perform-syntax-check-on-a-bash-script' rel='bookmark' title='How to perform syntax check on a bash script?'>How to perform syntax check on a bash script?</a></li>
<li><a href='http://www.linuxask.com/questions/how-to-get-the-pid-in-current-bash-shell-script' rel='bookmark' title='How to get the PID in current bash shell script'>How to get the PID in current bash shell script</a></li>
<li><a href='http://www.linuxask.com/questions/how-to-execute-a-command-repeatedly-using-bash' rel='bookmark' title='How to execute a command repeatedly using bash'>How to execute a command repeatedly using bash</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>How to echo a tab in bash?</p>
<p><strong>Answer:</strong></p>
<p>In Bash script, if you want to print out unprintable characters such as tab, you need to use <strong>-e</strong> flag together with the <strong>echo </strong>command.</p>
<p>E.g.</p>
<pre><code>echo -e "\tfoo\tbar"</code></pre>
<p>Related posts:<ol>
<li><a href='http://www.linuxask.com/questions/how-to-perform-syntax-check-on-a-bash-script' rel='bookmark' title='How to perform syntax check on a bash script?'>How to perform syntax check on a bash script?</a></li>
<li><a href='http://www.linuxask.com/questions/how-to-get-the-pid-in-current-bash-shell-script' rel='bookmark' title='How to get the PID in current bash shell script'>How to get the PID in current bash shell script</a></li>
<li><a href='http://www.linuxask.com/questions/how-to-execute-a-command-repeatedly-using-bash' rel='bookmark' title='How to execute a command repeatedly using bash'>How to execute a command repeatedly using bash</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.linuxask.com/questions/how-to-echo-a-tab-in-bash/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple environment variable usage in Linux</title>
		<link>http://www.linuxask.com/questions/simple-environment-variable-usage-in-linux</link>
		<comments>http://www.linuxask.com/questions/simple-environment-variable-usage-in-linux#comments</comments>
		<pubDate>Sun, 17 Oct 2010 16:31:45 +0000</pubDate>
		<dc:creator>Linux Ask!</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Basic Linux]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://www.linuxask.com/?p=2450</guid>
		<description><![CDATA[Simple environment variable usage in Linux Answer: In Linux, the most basic way to set an environment variable is use the "=" operator. For example: # foo=bar # echo $foo bar Related posts: How to unset an environment variable in bash How to add a directory into the PATH environment variable? What are PHP variable <a href='http://www.linuxask.com/questions/simple-environment-variable-usage-in-linux'>[...]</a>
Related posts:<ol>
<li><a href='http://www.linuxask.com/questions/how-to-unset-an-environment-variable-in-bash' rel='bookmark' title='How to unset an environment variable in bash'>How to unset an environment variable in bash</a></li>
<li><a href='http://www.linuxask.com/questions/how-to-add-a-directory-into-the-path-environment-variable' rel='bookmark' title='How to add a directory into the PATH environment variable?'>How to add a directory into the PATH environment variable?</a></li>
<li><a href='http://www.linuxask.com/questions/what-are-php-variable-variables' rel='bookmark' title='What are PHP variable variables?'>What are PHP variable variables?</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Simple environment variable usage in Linux</p>
<p><strong>Answer:</strong></p>
<p>In Linux, the most basic way to set an environment variable is use the "<strong>=</strong>" operator.</p>
<p>For example:</p>
<pre><code># foo=bar
# echo $foo
bar
</code></pre>
<p>Related posts:<ol>
<li><a href='http://www.linuxask.com/questions/how-to-unset-an-environment-variable-in-bash' rel='bookmark' title='How to unset an environment variable in bash'>How to unset an environment variable in bash</a></li>
<li><a href='http://www.linuxask.com/questions/how-to-add-a-directory-into-the-path-environment-variable' rel='bookmark' title='How to add a directory into the PATH environment variable?'>How to add a directory into the PATH environment variable?</a></li>
<li><a href='http://www.linuxask.com/questions/what-are-php-variable-variables' rel='bookmark' title='What are PHP variable variables?'>What are PHP variable variables?</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.linuxask.com/questions/simple-environment-variable-usage-in-linux/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Multi-line string in Bash</title>
		<link>http://www.linuxask.com/questions/multi-line-string-in-bash</link>
		<comments>http://www.linuxask.com/questions/multi-line-string-in-bash#comments</comments>
		<pubDate>Sat, 11 Sep 2010 03:39:47 +0000</pubDate>
		<dc:creator>Linux Ask!</dc:creator>
				<category><![CDATA[Bash]]></category>

		<guid isPermaLink="false">http://www.linuxask.com/?p=2124</guid>
		<description><![CDATA[Multi-line strings in Bash Answer: Bash support multiple line string, e.g. #!/bin/bash sort &#60;&#60;EOT apple orange banna EOT When you execute the script, # bash test.sh It gives: apple banna orange Related posts: Multi-line string in PHP Multi-line string in Ruby Multi-line string in Perl
Related posts:<ol>
<li><a href='http://www.linuxask.com/questions/multi-line-string-in-php' rel='bookmark' title='Multi-line string in PHP'>Multi-line string in PHP</a></li>
<li><a href='http://www.linuxask.com/questions/multi-line-string-in-ruby' rel='bookmark' title='Multi-line string in Ruby'>Multi-line string in Ruby</a></li>
<li><a href='http://www.linuxask.com/questions/multi-line-string-in-perl' rel='bookmark' title='Multi-line string in Perl'>Multi-line string in Perl</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Multi-line strings in Bash</p>
<p><strong>Answer:</strong></p>
<p><strong>Bash </strong>support multiple line string, e.g.</p>
<pre><code>#!/bin/bash
sort  &lt;&lt;EOT
apple
orange
banna
EOT
</code></pre>
<p>When you execute the script,</p>
<p><code># bash test.sh</code></p>
<p>It gives:</p>
<pre><code>apple
banna
orange
</code></pre>
<p>Related posts:<ol>
<li><a href='http://www.linuxask.com/questions/multi-line-string-in-php' rel='bookmark' title='Multi-line string in PHP'>Multi-line string in PHP</a></li>
<li><a href='http://www.linuxask.com/questions/multi-line-string-in-ruby' rel='bookmark' title='Multi-line string in Ruby'>Multi-line string in Ruby</a></li>
<li><a href='http://www.linuxask.com/questions/multi-line-string-in-perl' rel='bookmark' title='Multi-line string in Perl'>Multi-line string in Perl</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.linuxask.com/questions/multi-line-string-in-bash/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to perform syntax check on a bash script?</title>
		<link>http://www.linuxask.com/questions/how-to-perform-syntax-check-on-a-bash-script</link>
		<comments>http://www.linuxask.com/questions/how-to-perform-syntax-check-on-a-bash-script#comments</comments>
		<pubDate>Sun, 30 May 2010 14:47:55 +0000</pubDate>
		<dc:creator>Linux Ask!</dc:creator>
				<category><![CDATA[Bash]]></category>

		<guid isPermaLink="false">http://www.linuxask.com/?p=1686</guid>
		<description><![CDATA[How to perform syntax check on a bash script? Answer: You can perform syntax check on a bash script, without actually running it using the following command: # bash -n script.sh But if your script contain execution of other program, bash will not try to run it, even if it does not exist, error of <a href='http://www.linuxask.com/questions/how-to-perform-syntax-check-on-a-bash-script'>[...]</a>
Related posts:<ol>
<li><a href='http://www.linuxask.com/questions/how-to-perform-syntax-check-for-python-program' rel='bookmark' title='How to perform syntax check for Python program'>How to perform syntax check for Python program</a></li>
<li><a href='http://www.linuxask.com/questions/how-to-perform-syntax-check-for-perl-program' rel='bookmark' title='How to perform syntax check for Perl program'>How to perform syntax check for Perl program</a></li>
<li><a href='http://www.linuxask.com/questions/perform-syntax-check-to-php-files' rel='bookmark' title='Perform syntax check to PHP files'>Perform syntax check to PHP files</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>How to perform syntax check on a bash script?</p>
<p><strong>Answer:</strong></p>
<p>You can perform syntax check on a bash script, without actually running it using the following command:</p>
<p><code># bash -n script.sh</code></p>
<p>But if your script contain execution of other program, bash will not try to run it, even if it does not exist, error of this type will not be returned.</p>
<p>Related posts:<ol>
<li><a href='http://www.linuxask.com/questions/how-to-perform-syntax-check-for-python-program' rel='bookmark' title='How to perform syntax check for Python program'>How to perform syntax check for Python program</a></li>
<li><a href='http://www.linuxask.com/questions/how-to-perform-syntax-check-for-perl-program' rel='bookmark' title='How to perform syntax check for Perl program'>How to perform syntax check for Perl program</a></li>
<li><a href='http://www.linuxask.com/questions/perform-syntax-check-to-php-files' rel='bookmark' title='Perform syntax check to PHP files'>Perform syntax check to PHP files</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.linuxask.com/questions/how-to-perform-syntax-check-on-a-bash-script/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to unset an environment variable in bash</title>
		<link>http://www.linuxask.com/questions/how-to-unset-an-environment-variable-in-bash</link>
		<comments>http://www.linuxask.com/questions/how-to-unset-an-environment-variable-in-bash#comments</comments>
		<pubDate>Sun, 21 Mar 2010 04:01:16 +0000</pubDate>
		<dc:creator>Linux Ask!</dc:creator>
				<category><![CDATA[Bash]]></category>

		<guid isPermaLink="false">http://www.linuxask.com/?p=1499</guid>
		<description><![CDATA[How to unset an environment variable in bash Answer: To unset an environment variable in bash, you can use the unset command. Example: # export foo=bar # echo $foo bar # unset foo # echo $foo Related posts: How to add a directory into the PATH environment variable? Simple environment variable usage in Linux How <a href='http://www.linuxask.com/questions/how-to-unset-an-environment-variable-in-bash'>[...]</a>
Related posts:<ol>
<li><a href='http://www.linuxask.com/questions/how-to-add-a-directory-into-the-path-environment-variable' rel='bookmark' title='How to add a directory into the PATH environment variable?'>How to add a directory into the PATH environment variable?</a></li>
<li><a href='http://www.linuxask.com/questions/simple-environment-variable-usage-in-linux' rel='bookmark' title='Simple environment variable usage in Linux'>Simple environment variable usage in Linux</a></li>
<li><a href='http://www.linuxask.com/questions/how-to-set-a-shell-variable' rel='bookmark' title='How to set a shell variable'>How to set a shell variable</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>How to unset an environment variable in bash</p>
<p><strong>Answer:</strong></p>
<p>To unset an environment variable in bash, you can use the <strong>unset </strong>command.</p>
<p>Example:</p>
<pre><code># export foo=bar
# echo $foo
bar
# unset foo
# echo $foo

</code></pre>
<p>Related posts:<ol>
<li><a href='http://www.linuxask.com/questions/how-to-add-a-directory-into-the-path-environment-variable' rel='bookmark' title='How to add a directory into the PATH environment variable?'>How to add a directory into the PATH environment variable?</a></li>
<li><a href='http://www.linuxask.com/questions/simple-environment-variable-usage-in-linux' rel='bookmark' title='Simple environment variable usage in Linux'>Simple environment variable usage in Linux</a></li>
<li><a href='http://www.linuxask.com/questions/how-to-set-a-shell-variable' rel='bookmark' title='How to set a shell variable'>How to set a shell variable</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.linuxask.com/questions/how-to-unset-an-environment-variable-in-bash/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to check the bash shell version</title>
		<link>http://www.linuxask.com/questions/how-to-check-the-bash-shell-version</link>
		<comments>http://www.linuxask.com/questions/how-to-check-the-bash-shell-version#comments</comments>
		<pubDate>Mon, 01 Mar 2010 13:13:46 +0000</pubDate>
		<dc:creator>Linux Ask!</dc:creator>
				<category><![CDATA[Bash]]></category>

		<guid isPermaLink="false">http://www.linuxask.com/?p=1431</guid>
		<description><![CDATA[How to check the bash shell version Answer: To check the current bash shell version # bash -version GNU bash, version 3.2.48(1)-release (x86_64-pc-linux-gnu) Copyright (C) 2007 Free Software Foundation, Inc. Related posts: Check if a file exist in Bash Shell How to get the PID in current bash shell script How to check what Linux <a href='http://www.linuxask.com/questions/how-to-check-the-bash-shell-version'>[...]</a>
Related posts:<ol>
<li><a href='http://www.linuxask.com/questions/check-if-a-file-exist-in-bash-shell' rel='bookmark' title='Check if a file exist in Bash Shell'>Check if a file exist in Bash Shell</a></li>
<li><a href='http://www.linuxask.com/questions/how-to-get-the-pid-in-current-bash-shell-script' rel='bookmark' title='How to get the PID in current bash shell script'>How to get the PID in current bash shell script</a></li>
<li><a href='http://www.linuxask.com/questions/how-to-check-what-linux-version-i-am-using' rel='bookmark' title='How to check what Linux version I am using?'>How to check what Linux version I am using?</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>How to check the bash shell version</p>
<p><strong>Answer:</strong></p>
<p>To check the current <strong>bash </strong>shell version</p>
<pre><code># bash -version
GNU bash, version 3.2.48(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2007 Free Software Foundation, Inc.
</code></pre>
<p>Related posts:<ol>
<li><a href='http://www.linuxask.com/questions/check-if-a-file-exist-in-bash-shell' rel='bookmark' title='Check if a file exist in Bash Shell'>Check if a file exist in Bash Shell</a></li>
<li><a href='http://www.linuxask.com/questions/how-to-get-the-pid-in-current-bash-shell-script' rel='bookmark' title='How to get the PID in current bash shell script'>How to get the PID in current bash shell script</a></li>
<li><a href='http://www.linuxask.com/questions/how-to-check-what-linux-version-i-am-using' rel='bookmark' title='How to check what Linux version I am using?'>How to check what Linux version I am using?</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.linuxask.com/questions/how-to-check-the-bash-shell-version/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to execute a command repeatedly using bash</title>
		<link>http://www.linuxask.com/questions/how-to-execute-a-command-repeatedly-using-bash</link>
		<comments>http://www.linuxask.com/questions/how-to-execute-a-command-repeatedly-using-bash#comments</comments>
		<pubDate>Thu, 11 Feb 2010 14:29:40 +0000</pubDate>
		<dc:creator>Linux Ask!</dc:creator>
				<category><![CDATA[Bash]]></category>

		<guid isPermaLink="false">http://www.linuxask.com/?p=1176</guid>
		<description><![CDATA[How to execute a command repeatedly using bash Answer: The following simple bash script will run the echo command, sleep 10 seconds repeatedly. #!/bin/bash while [1]; do echo "Hello!"; sleep 10; done Related posts: How to measure the time needed to execute a command How to echo a tab in bash? How to perform syntax <a href='http://www.linuxask.com/questions/how-to-execute-a-command-repeatedly-using-bash'>[...]</a>
Related posts:<ol>
<li><a href='http://www.linuxask.com/questions/how-to-measure-the-time-needed-to-execute-a-command' rel='bookmark' title='How to measure the time needed to execute a command'>How to measure the time needed to execute a command</a></li>
<li><a href='http://www.linuxask.com/questions/how-to-echo-a-tab-in-bash' rel='bookmark' title='How to echo a tab in bash?'>How to echo a tab in bash?</a></li>
<li><a href='http://www.linuxask.com/questions/how-to-perform-syntax-check-on-a-bash-script' rel='bookmark' title='How to perform syntax check on a bash script?'>How to perform syntax check on a bash script?</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>How to execute a command repeatedly using bash</p>
<p><strong>Answer:</strong></p>
<p>The following simple bash script will run the <strong>echo </strong>command, <strong>sleep </strong>10 seconds repeatedly.</p>
<pre><code>#!/bin/bash 

while [1];
do
    echo "Hello!";
    sleep 10;
done
</code></pre>
<p>Related posts:<ol>
<li><a href='http://www.linuxask.com/questions/how-to-measure-the-time-needed-to-execute-a-command' rel='bookmark' title='How to measure the time needed to execute a command'>How to measure the time needed to execute a command</a></li>
<li><a href='http://www.linuxask.com/questions/how-to-echo-a-tab-in-bash' rel='bookmark' title='How to echo a tab in bash?'>How to echo a tab in bash?</a></li>
<li><a href='http://www.linuxask.com/questions/how-to-perform-syntax-check-on-a-bash-script' rel='bookmark' title='How to perform syntax check on a bash script?'>How to perform syntax check on a bash script?</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.linuxask.com/questions/how-to-execute-a-command-repeatedly-using-bash/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

