<?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 For All &#187; bash</title>
	<atom:link href="http://www.linux4all.in/tag/bash/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.linux4all.in</link>
	<description>Making Linux Usable For All From Newbies To Techies</description>
	<lastBuildDate>Wed, 04 Aug 2010 05:09:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Basic Shell Scripting</title>
		<link>http://www.linux4all.in/2008/05/31/basic-shell-scripting/</link>
		<comments>http://www.linux4all.in/2008/05/31/basic-shell-scripting/#comments</comments>
		<pubDate>Sat, 31 May 2008 05:14:18 +0000</pubDate>
		<dc:creator>Kunal Gautam</dc:creator>
				<category><![CDATA[Information]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[shell scripting]]></category>

		<guid isPermaLink="false">http://linux.tech-nologic.info/?p=10</guid>
		<description><![CDATA[Shell scripts or simply scripts are collection or group of command that are stored in a file.This post will Guide you little bit about Shell Scripting]]></description>
			<content:encoded><![CDATA[<p>Hello to all. Sorry for delayed posting of posts.I was little bit busy in Server settings of RHEL.</p>
<p>So you have in mind what is shell scripting ????</p>
<p><strong>Shell scripts</strong> or simply scripts are collection or group of command that are stored in a file.Now you will think what&#8217;s the use of it ?<br />
Actually it is not possible to run each and every command manually on pc.If this is a repetative job then its again became a headache. So we use Scripting to store those commands and get Outputs. Even we can sheduled the script to run at particular time.</p>
<p><span id="more-10"></span> So here we start to write a simple script which will print &#8220;Hello World&#8221;</p>
<p><strong>Step One</strong><br />
Create a file name firstscript.sh   [ remember to give it .sh extension ]<br />
Now open any text editor of your choice and write following commands</p>
<p><strong>Step two</strong> : <strong><em>Commands [ Below this Command Begin , Description Given after the  script is completed ]</em></strong></p>
<p><em>#! /bin/bash<br />
# You Can Comment any thing here<br />
# make sure u use a hash in begningecho &#8220;Hello World&#8221;# End of Script</em></p>
<p><em> </em></p>
<p><strong>Description</strong><br />
First Line should define which shell you are using<br />
there are several shells present in unix system, some of the following are :-<br />
/bin/bash        Bash Shell<br />
/bin/sh          Bourne Shell<br />
/bin/csh	     C Shell<br />
/usr/bin/perl    Perl Script Shell<br />
/usr/bin/python  Python Script Shell</p>
<p>The First Line should start with &#8220;#!&#8221; Followed by Shell<br />
eg<br />
#! /bin/sh<br />
#! /bin/csh<br />
#! /usr/bin/perl</p>
<p>Then give commands in the file like I&#8217;ve supplied &#8220;echo&#8221; Command in this script<br />
or you can even give direct commands also<br />
like<br />
<em>#! /bin/bash<br />
date<br />
cal<br />
clear</em></p>
<p>It will give output of date &amp; cal command subsequently and clear screen</p>
<p>You can even provide comment to a command just use a hash &#8220;#&#8221; in line and it will act as comment</p>
<p><strong>Step 3<br />
</strong>Now question arises how to run this script ???<br />
its very simple<br />
there are two methods<br />
<strong><em>Method 1</em></strong><br />
supply following command<br />
sh firstscript.sh</p>
<p><strong><em>Method 2</em></strong><br />
Chmod[chmod command change permission of the file] the file to make it executable file<br />
command is as follows<br />
chmod 777 firstscript.sh</p>
<p>and run script by supplying following thing in your commadn terminal<br />
./firstscript.sh</p>
<p><strong><em>Stay tuned for more articles on shell scripting</em></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.linux4all.in/2008/05/31/basic-shell-scripting/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
