<div dir="ltr">Oh and thanks for explaining the reasoning behind the curly braces, that can be important in such a situation as you explained. I often use it because I may do a statement such as:<br><br>for i in `ls *`; do filename=$( echo $i | sed -ie 's/\.*//'); convert $i -geometry 600x480 JPG:${filename}-thumb.jpg; done<div>
<br></div><div>So if you need to have the output of your variable immediately followed by some other string it is important to surround it with the curly braces. </div><div><br></div><div style>I am sure there are other methods that are a bit easier than what I have done there. </div>
<div style><br></div><div style>Dan</div><div><div><br></div><div style><br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Feb 11, 2013 at 5:03 PM, Dan Kulinski <span dir="ltr"><<a href="mailto:daniel@kulinski.net" target="_blank">daniel@kulinski.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Marcus, <div><br></div><div>I rushed my explanation and missed something. You are quite right you can't force expansion in single quotes. What you do is something like the following:</div>
<div>
var="'scale=2;${total}/60'"; echo $var | bc<span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Dan</div></font></span></div>
<div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Feb 11, 2013 at 5:00 PM, marcus hall <span dir="ltr"><<a href="mailto:marcus@tuells.org" target="_blank">marcus@tuells.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On Mon, Feb 11, 2013 at 03:27:08PM -0700, Dan Kulinski wrote:<br>
> When you use single quotes you stop variable expansion. Try double quotes<br>
> or forcing expansion with scale='2;${total}/60'<br>
><br>
> Dan<br>
<br>
</div>Double quotes is definately the answer.. But, I don't understand what<br>
you're trying to say about "forcing expansion".<br>
<br>
Try the following:<br>
<br>
xxx=test<br>
<br>
echo $xxx<br>
echo "$xxx"<br>
echo '$xxx'<br>
echo ${xxx}<br>
echo "${xxx}"<br>
echo '${xxx}'<br>
<br>
I think you will find that the single quotes never perform variable<br>
substitutuion. Where the curly braces are useful are when the variable<br>
is immediately followed by a character that could be part of a variable<br>
name. For example:<br>
<br>
echo $xxx_yyy<br>
echo ${xxx}_yyy<br>
<br>
The first case tries to expand the variable xxx_yyy, while the second case<br>
expands the variable xxx and follows that expansion with "_yyy". Sometimes<br>
it is very important, but usually it is not needed.<br>
<span><font color="#888888"><br>
marcus hall<br>
<a href="mailto:marcus@tuells.org" target="_blank">marcus@tuells.org</a><br>
</font></span><div><div>_______________________________________________<br>
clue mailing list: <a href="mailto:clue@cluedenver.org" target="_blank">clue@cluedenver.org</a><br>
For information, account preferences, or to unsubscribe see:<br>
<a href="http://cluedenver.org/mailman/listinfo/clue" target="_blank">http://cluedenver.org/mailman/listinfo/clue</a><br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>