<?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: Unix bc Command Line Calculator in Batch Mode</title>
	<atom:link href="http://www.thegeekstuff.com/2009/11/unix-bc-command-line-calculator-in-batch-mode/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thegeekstuff.com/2009/11/unix-bc-command-line-calculator-in-batch-mode/</link>
	<description>Guides, HowTos and Tips for Technology Geeks</description>
	<lastBuildDate>Fri, 19 Mar 2010 15:05:19 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Destillat KW47-2009 &#124; duetsch.info - GNU/Linux, Open Source, Softwareentwicklung, Selbstmanagement, Vim ...</title>
		<link>http://www.thegeekstuff.com/2009/11/unix-bc-command-line-calculator-in-batch-mode/comment-page-1/#comment-22997</link>
		<dc:creator>Destillat KW47-2009 &#124; duetsch.info - GNU/Linux, Open Source, Softwareentwicklung, Selbstmanagement, Vim ...</dc:creator>
		<pubDate>Fri, 20 Nov 2009 09:47:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.thegeekstuff.com/?p=2738#comment-22997</guid>
		<description>[...] Unix bc Command Line Calculator in Batch Mode [...]</description>
		<content:encoded><![CDATA[<p>[...] Unix bc Command Line Calculator in Batch Mode [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul Reiber</title>
		<link>http://www.thegeekstuff.com/2009/11/unix-bc-command-line-calculator-in-batch-mode/comment-page-1/#comment-22846</link>
		<dc:creator>Paul Reiber</dc:creator>
		<pubDate>Wed, 18 Nov 2009 23:25:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.thegeekstuff.com/?p=2738#comment-22846</guid>
		<description>Hi, Ramesh!

There are a couple of useful other ways to use bc that you didn&#039;t mention.  

The first is using &quot;HERE files&quot;.  For example:

&lt;pre&gt;
$ bc &lt;&lt; HERE
&gt; 1+3
&gt; last/2
&gt; HERE
4
2
$
&lt;/pre&gt;

in this case, the &gt; (and $ of course) are prompts from the interactive shell.  However, the same thing works within a shell script.  Shell variable expansion will apply to the content in the HERE file, so this can very powerful; the HERE file content doesn&#039;t have to be static.  Note that both numbers AND operators for bc can be represented in variables.

The second useful way to use bc is the backtick operator.  AKA &#039;results of&#039;.

$ x=`echo 4+1&#124;bc`
$ echo $x
5

This is kind of like &#039;eval&#039; but it&#039;s eval-ing a bc expression rather than a shell expression.  Again, a pretty powerful construct.

Thanks for the ongoing stream of great geek stuff!
-Paul</description>
		<content:encoded><![CDATA[<p>Hi, Ramesh!</p>
<p>There are a couple of useful other ways to use bc that you didn&#8217;t mention.  </p>
<p>The first is using &#8220;HERE files&#8221;.  For example:</p>
<pre>
$ bc < < HERE
> 1+3
> last/2
> HERE
4
2
$
</pre>
<p>in this case, the &gt; (and $ of course) are prompts from the interactive shell.  However, the same thing works within a shell script.  Shell variable expansion will apply to the content in the HERE file, so this can very powerful; the HERE file content doesn&#8217;t have to be static.  Note that both numbers AND operators for bc can be represented in variables.</p>
<p>The second useful way to use bc is the backtick operator.  AKA &#8216;results of&#8217;.</p>
<p>$ x=`echo 4+1|bc`<br />
$ echo $x<br />
5</p>
<p>This is kind of like &#8216;eval&#8217; but it&#8217;s eval-ing a bc expression rather than a shell expression.  Again, a pretty powerful construct.</p>
<p>Thanks for the ongoing stream of great geek stuff!<br />
-Paul</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: balmar</title>
		<link>http://www.thegeekstuff.com/2009/11/unix-bc-command-line-calculator-in-batch-mode/comment-page-1/#comment-22825</link>
		<dc:creator>balmar</dc:creator>
		<pubDate>Wed, 18 Nov 2009 19:31:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.thegeekstuff.com/?p=2738#comment-22825</guid>
		<description>Thanks Ramesh. Do you know calc at
http://www.isthe.com/chongo/tech/comp/calc/ ? (And I also have one in my mobile: http://midp-calc.sourceforge.net/Calc.html ) I love them both.</description>
		<content:encoded><![CDATA[<p>Thanks Ramesh. Do you know calc at<br />
<a href="http://www.isthe.com/chongo/tech/comp/calc/" rel="nofollow">http://www.isthe.com/chongo/tech/comp/calc/</a> ? (And I also have one in my mobile: <a href="http://midp-calc.sourceforge.net/Calc.html" rel="nofollow">http://midp-calc.sourceforge.net/Calc.html</a> ) I love them both.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dj</title>
		<link>http://www.thegeekstuff.com/2009/11/unix-bc-command-line-calculator-in-batch-mode/comment-page-1/#comment-22817</link>
		<dc:creator>dj</dc:creator>
		<pubDate>Wed, 18 Nov 2009 18:22:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.thegeekstuff.com/?p=2738#comment-22817</guid>
		<description>Dave Taylor had an article in Linux Journal on this topic:

Work the Shell - Solve: a Command-Line Calculator
http://www.linuxjournal.com/article/9891</description>
		<content:encoded><![CDATA[<p>Dave Taylor had an article in Linux Journal on this topic:</p>
<p>Work the Shell &#8211; Solve: a Command-Line Calculator<br />
<a href="http://www.linuxjournal.com/article/9891" rel="nofollow">http://www.linuxjournal.com/article/9891</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
