
03-21-2009
|
|
Shell programmer, author
|
|
|
Join Date: Mar 2007
Location: Toronto, Canada
Posts: 2,372
|
|
Quote:
Originally Posted by dharol
I know there are many similar questions but have not been able to find a syntax in the posts that work.
|
Top Ten Reasons not to use the C shell
Csh problems
Csh Programming Considered Harmful
Quote:
I calculate var1 and var2 in a previous portion of the script. Then i want to set var3 to var2-var1.
Have tried all kinds of variations on:
var3 = `"expr $var2 - $var1`
|
Code:
@ var3 = $var2 - $var1
In a real scripting shell, use:
Code:
var3=$(( $var2 - $var1 ))
|