<?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: How to Write Shell Script</title>
	<atom:link href="http://www.dbuggr.com/abhaybharti/write-shell-script/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dbuggr.com/abhaybharti/write-shell-script/</link>
	<description>Share Knowledge &#38; Be Rewarded</description>
	<lastBuildDate>Fri, 03 Feb 2012 23:13:48 -0600</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: Abhay</title>
		<link>http://www.dbuggr.com/abhaybharti/write-shell-script/comment-page-1/#comment-668</link>
		<dc:creator>Abhay</dc:creator>
		<pubDate>Tue, 15 Dec 2009 10:06:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.dbuggr.com/abhaybharti/write-shell-script/#comment-668</guid>
		<description>Following steps are required to write shell script:

(1) Use any editor like vi to write shell script.
(2) After writing shell script set execute permission for your script as follows
syntax:

chmod permission your-script-name

Examples:

$ chmod +x your-script-name
$ chmod 755 your-script-name

Note: This will set read write execute(7) permission for owner, for group and other permission is read and execute only(5).

(3) Execute your script as
syntax:

bash your-script-name
sh your-script-name

./your-script-name

Examples:
$ bash bar
$ sh bar
$ ./bar

NOTE In the last syntax ./ means current directory, But only . (dot) means execute given command file in current shell without starting the new copy of shell, The syntax for . (dot) command is as follows. Syntax:

. command-name

Example:
$ . foo

Now you are ready to write first shell script that will print &quot;Knowledge is Power&quot; on screen. See the common vi command list , if you are new to vi.

$ vi first
#
# My first shell script
#
clear
echo &quot;Knowledge is Power&quot;

After saving the above script, you can run the script as follows:

$ ./first</description>
		<content:encoded><![CDATA[<p>Following steps are required to write shell script:</p>
<p>(1) Use any editor like vi to write shell script.<br />
(2) After writing shell script set execute permission for your script as follows<br />
syntax:</p>
<p>chmod permission your-script-name</p>
<p>Examples:</p>
<p>$ chmod +x your-script-name<br />
$ chmod 755 your-script-name</p>
<p>Note: This will set read write execute(7) permission for owner, for group and other permission is read and execute only(5).</p>
<p>(3) Execute your script as<br />
syntax:</p>
<p>bash your-script-name<br />
sh your-script-name</p>
<p>./your-script-name</p>
<p>Examples:<br />
$ bash bar<br />
$ sh bar<br />
$ ./bar</p>
<p>NOTE In the last syntax ./ means current directory, But only . (dot) means execute given command file in current shell without starting the new copy of shell, The syntax for . (dot) command is as follows. Syntax:</p>
<p>. command-name</p>
<p>Example:<br />
$ . foo</p>
<p>Now you are ready to write first shell script that will print &#8220;Knowledge is Power&#8221; on screen. See the common vi command list , if you are new to vi.</p>
<p>$ vi first<br />
#<br />
# My first shell script<br />
#<br />
clear<br />
echo &#8220;Knowledge is Power&#8221;</p>
<p>After saving the above script, you can run the script as follows:</p>
<p>$ ./first</p>
]]></content:encoded>
	</item>
</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
