Error:

Define function

function_name () {
    echo "Some function"
}

# Call function
function_name

Local variable in function

function_name () {
   # No spaces around "="
    local some_var=10
    echo "Some function (${some_var})"
}

# Call function
function_name
# prints "Testing global: "
echo "Testing global: ${some_var}"

Accessing function arguments

print_sum () {
    echo $(( $1 + $2 ))
}

print_sum 10 5

Function return value

my_sum () {
    echo $(( $1 + $2 ))
}

# result is 15
result=$(my_sum 10 5)