On Thu, 12 May 2005, Tony Jo wrote:
Oh sorry. Didn't look at it closely enough.
Thanks, that did solve most of the issues,
What did? Please quote enough of the previous post that we can tell
what you are referring to.
but now I'm just wondering if the following is valid?
Does it work?
temp=`expr $val1 + $val2`
$temp > file
Everything besides this seems to be working fine now
Does $temp contain a command or the result of a command? If it's a
command, then it will work, but that's not what you have.
You want either:
temp='expr $val1 + $val2' ## $temp contains the literal command
$temp > file
Or:
temp=`expr $val1 + $val2` ## $temp contains the output of the commnd
echo "$temp" > file
Or, since you are using bash:
temp=$(( $val1 + $val2 ))
--
Chris F.A. Johnson <http://cfaj.freeshell.org>
==================================================================
Shell Scripting Recipes: A Problem-Solution Approach, 2005, Apress
<http://www.torfree.net/~chris/books/ssr.html>
_______________________________________________
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash