<?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>Animesh Kumar {itsAnimesh} &#187; Bash</title>
	<atom:link href="http://itsanimesh.com/tag/bash/feed/" rel="self" type="application/rss+xml" />
	<link>http://itsanimesh.com</link>
	<description>Tech Geek / FOSS Enthusiasts</description>
	<lastBuildDate>Sun, 10 Jul 2011 04:49:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Howto : Twitter from Command Line&#8230;</title>
		<link>http://itsanimesh.com/2010/01/25/howto-twitter-from-command-line/</link>
		<comments>http://itsanimesh.com/2010/01/25/howto-twitter-from-command-line/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 09:07:01 +0000</pubDate>
		<dc:creator>itsAnimesh</dc:creator>
				<category><![CDATA[Tech Gyaan]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[Command Line]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[FOSS]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://itsanimesh.com/?p=1593</guid>
		<description><![CDATA[This is a tutorial explaining how to post to Twitter using command-line in Linux, without needing to even open up your web browser&#8230;. First, install the curl package: sudo apt-get install curl Next, create a script anywhere in your $PATH, for example tweet.sh inside ~/bin, where ~ is your home directory (make sure ~/bin is ...]]></description>
			<content:encoded><![CDATA[<p>This is a tutorial explaining how to post to Twitter using command-line in Linux, without needing to even open up your web browser&#8230;.</p>
<p>First, install the curl package:</p>
<pre>sudo apt-get install curl</pre>
<p>Next, create a script anywhere in your <strong>$PATH</strong>, for example <strong>tweet.sh</strong> inside <strong>~/bin</strong>, where ~ is your home directory (make sure ~/bin is included in your $PATH variable, in case echo $PATH doesn&#8217;t return it, edit <strong>~/.bashrc</strong> and add a line like this: <strong>export PATH=/home/USER/bin/:$PATH</strong>)&#8230;</p>
<p>The script <strong>tweet.sh</strong> should contain the following:<span id="more-1593"></span><br />
<code> </code></p>
<p><code> </code></p>
<p><code> </code></p>
<p>&nbsp;</p>
<p><code></p>
<pre>#!/bin/sh

############EDIT THE FOLLOWING LINES...###########################
user="USERNAME"
pass="PASSWORD"
##################################################################

######################DO NOT EDIT BELOW THIS######################
tweet="${@}"

if [ $(echo "${tweet}" | wc -c) -gt 140 ]; then
    echo "FATAL: The tweet is longer than 140 characters!"
    exit 1
fi

curl -k -u ${user}:${pass} -d status="${tweet}" https://twitter.com/statuses/update.xml &gt;/dev/null 2&gt;&amp;1

if [ "$?" == "0" ]; then
    echo "Successful tweet!"
fi</pre>
<p></code></p>
<p>&nbsp;</p>
<p>Replace <strong>USERNAME </strong>and <strong>PASSWORD </strong>with your Twitter username and password, and then make the script executable:</p>
<pre>chmod 755 ~/bin/tweet.sh</pre>
<p>And now test it.. Just use it as :</p>
<pre>tweet.sh YOUR MESSAGE</pre>
<p>This should be all&#8230;</p>
<p>If you don&#8217;t want to copy paste the code for tweet.sh then use the following link to download <a href="http://itsanimesh.com/wp-content/uploads/2010/01/tweet.txt">tweet.txt</a> and RENAME it as tweet.sh</p>
]]></content:encoded>
			<wfw:commentRss>http://itsanimesh.com/2010/01/25/howto-twitter-from-command-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Work with Bash History!!!</title>
		<link>http://itsanimesh.com/2009/08/06/how-to-work-with-bash-history/</link>
		<comments>http://itsanimesh.com/2009/08/06/how-to-work-with-bash-history/#comments</comments>
		<pubDate>Thu, 06 Aug 2009 16:39:37 +0000</pubDate>
		<dc:creator>itsAnimesh</dc:creator>
				<category><![CDATA[Tech Gyaan]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://itsanimesh.com/?p=746</guid>
		<description><![CDATA[Although there are many shells available for Fedora, RedHat and its clones, such as tcsh, ksh, sh and the like, up until now bash still remains the default shell of choice. This does not come as a surprise because bash (which stands for Bourne Again Shell) has numerous lightning fast built-in commands that can manipulate ...]]></description>
			<content:encoded><![CDATA[<p>Although there are many shells available for Fedora, RedHat and its clones, such as tcsh, ksh, sh and the like, up until now bash still remains the default shell of choice.  This does not come as a surprise because bash (which stands for Bourne Again Shell) has numerous lightning fast built-in commands that can manipulate and explore system on large and limited scales.<span id="more-746"></span></p>
<p>Many times I observed, that Linux sysadmin beginners remember remember well how to move among the commands by pressing up and down arrows. They also remember how to use Tab in the command line for completion. Yet, somehow they forget that a great bash command <strong>history</strong> will pull out the complete history list of commands that they used.</p>
<p>Naturally, getting to see the whole list of commands might not come handy. It is much better, for example,  to go back to the last 10 commands and type in the terminal <strong>history 10</strong>. This will do the trick.</p>
<p>There are so many other built-in bash history commands that it will take hefty hundred pages to describe them all. I just want to mention another useful history manipulation command that is called simply <strong>fc</strong>.  This one is very valuable becaue it allow you to open vi editor and run the command after editing it to your liking. For example, <strong>fc 356</strong> will allow you to edit this command in vi and then immediately invoke it for you.</p>
<p>Cheers.. <img src='http://itsanimesh.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://itsanimesh.com/2009/08/06/how-to-work-with-bash-history/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

