RosettaCodeData/Task/Scope-Function-names-and-labels/UNIX-Shell/scope-function-names-and-labels.sh
Ingy döt Net b83f433714 tasks a-s
2013-04-10 23:57:08 -07:00

10 lines
304 B
Bash

#!/bin/sh
multiply 3 4 # This will not work
echo $? # A bogus value was returned because multiply definition has not yet been run.
multiply() {
return `expr $1 \* $2` # The backslash is required to suppress interpolation
}
multiply 3 4 # Ok. It works now.
echo $? # This gives 12