bash - I'm having trouble performing arithmetic expressions in UNIX -


i have following script:

  #!/bin/sh   r=3   r=$((r+5))   echo r 

however, error:

syntax error @ line 3: $ unexpected.

i don't understand i'm doing wrong. i'm following online guide letter http://www.unixtutorial.org/2008/06/arithmetic-operations-in-unix-scripts/

this sounds fine if you're using bash, $((r+5)) might not supported if you're using shell. /bin/sh point to? have considered replacing /bin/bash if it's available?


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -