<?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>Trylinux.org &#187; bash</title>
	<atom:link href="http://trylinux.org/category/bash/feed/" rel="self" type="application/rss+xml" />
	<link>http://trylinux.org</link>
	<description>Linux tips and advocacy</description>
	<lastBuildDate>Thu, 27 May 2010 14:51:48 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Sending email from the command line and specifying the from</title>
		<link>http://trylinux.org/2010/05/27/sending-email-from-the-command-line-and-specifying-the-from/</link>
		<comments>http://trylinux.org/2010/05/27/sending-email-from-the-command-line-and-specifying-the-from/#comments</comments>
		<pubDate>Thu, 27 May 2010 14:51:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://trylinux.org/?p=90</guid>
		<description><![CDATA[The easiest way to send an email from a Linux command line is this:
mail -s subject me@here.com < /dev/null
Sometimes you need to specify the from address, but I'm always forgetting the syntax.
echo "The message" &#124; mail -s "The subject" me@here.com -- -f sender@someplace.com  
]]></description>
			<content:encoded><![CDATA[<p>The easiest way to send an email from a Linux command line is this:<br />
<code>mail -s subject me@here.com < /dev/null</code></p>
<p>Sometimes you need to specify the from address, but I'm always forgetting the syntax.<br />
<code>echo "The message" | mail -s "The subject" me@here.com -- -f sender@someplace.com</code>  </p>
]]></content:encoded>
			<wfw:commentRss>http://trylinux.org/2010/05/27/sending-email-from-the-command-line-and-specifying-the-from/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sorting a loop in bash and other possibilites</title>
		<link>http://trylinux.org/2008/04/04/sorting-a-loop-in-bash-and-other-possibilites/</link>
		<comments>http://trylinux.org/2008/04/04/sorting-a-loop-in-bash-and-other-possibilites/#comments</comments>
		<pubDate>Fri, 04 Apr 2008 21:15:32 +0000</pubDate>
		<dc:creator>tip</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://trylinux.org/2008/04/04/sorting-a-loop-in-bash-and-other-possibilites/</guid>
		<description><![CDATA[As I said in my previous post, I learned a couple things about bash today.  I had a nice for loop that outputted the info I wanted, but not in the right order.  I thought to myself, man if this were php I would just put it in an array and sort it [...]]]></description>
			<content:encoded><![CDATA[<p>As I said in my previous post, I learned a couple things about bash today.  I had a nice for loop that outputted the info I wanted, but not in the right order.  I thought to myself, man if this were php I would just put it in an array and sort it before looping across it.  I bet this will be a pain in bash.</p>
<p>BUT, I was pleasantly surprised to find out how simple this really was.  If you want to perform an action the output of a loop in bash then you just pipe done into the fuction you want performed.  See the example below.</p>
<pre>for VAR in $VARS; do
{someaction}
done | sort -n</pre>
<p>Cool, right?</p>
]]></content:encoded>
			<wfw:commentRss>http://trylinux.org/2008/04/04/sorting-a-loop-in-bash-and-other-possibilites/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lineing up fields with BASH (or other programming languages)</title>
		<link>http://trylinux.org/2008/04/04/lineing-up-fields-with-bash-or-other-programming-languages/</link>
		<comments>http://trylinux.org/2008/04/04/lineing-up-fields-with-bash-or-other-programming-languages/#comments</comments>
		<pubDate>Fri, 04 Apr 2008 21:08:59 +0000</pubDate>
		<dc:creator>tip</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://trylinux.org/2008/04/04/lineing-up-fields-with-bash-or-other-programming-languages/</guid>
		<description><![CDATA[Learned a couple things about bash today.  I was wanting to print something out nicely, so I was using tabs to separate fields.  As you know, nothing ever lines up if you do not have values very similar in size.  So I was about to search Google for the problem when I [...]]]></description>
			<content:encoded><![CDATA[<p>Learned a couple things about bash today.  I was wanting to print something out nicely, so I was using tabs to separate fields.  As you know, nothing ever lines up if you do not have values very similar in size.  So I was about to search Google for the problem when I had a moment of sheer brilliance. <img src='http://trylinux.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   I thought I&#8217;ll just concatenate a bunch of spaces on the end of the variable and then use cut to grab how many characters I want.  I was very proud of myself, but then bash quickly humbled me by condensing all my spaces I had added to the variable.</p>
<p>So, back to the all knowing Google.  Turns out you have to quote your variable when you use it if you don&#8217;t want bash to truncate the spaces.  So I quoted my variable when using it and all is good.</p>
<pre>BUFFER="$VAR                                                                "
NICE_VAR=`echo "$VAR" | cut -c -15`
echo "$VAR $VAR2"</pre>
]]></content:encoded>
			<wfw:commentRss>http://trylinux.org/2008/04/04/lineing-up-fields-with-bash-or-other-programming-languages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
