#!/bin/bash # playing with variables in bash # just set the name to a value? # AHA -- one gotcha: CANNOT have spaces around the = sign!? # uncomment these, and you'll see there are problems... #myVar = "moooo" #myVar= "mooooo" #myVar ="mooo" myVar="moooo" # ...but use $ in front of it to obtain its value... echo $myVar # http://wiki.bash-hackers.org/commands/builtin/let # # "The let builtin command evaluates each supplied word # from left to # right as an arithmetic expression and returns an exit code # according to the truth value of the rightmost expression. # # 0 (TRUE) when arg evaluated to not 0 (arithmetic "true") # 1 (FALSE) when arg evaluated to 0 (arithmetic "false")" myNum=3 # using let here allows the arithmetic addition of # adding myNum's value to 1 take place let myNum+=1 echo "should see 4: $myNum"