f ()  # two-parameter function.
{
  typeset x             # declare local variable.
  (( x = $1 * $2 ))     # set local variable.
  echo local x = $x
  return $x
}
# main program.
x=1                     # set global variable.
echo global x = $x      # display value of global before function call.
f 3 4                   # call function.
result=$?               # save exit code.
echo return value from function was $result
