Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

bash function arguments

#!/usr/bin/env sh

foo 1  # this will fail because foo has not been declared yet.

foo() {
    echo "Parameter #1 is $1"
}

foo 2 # this will work.
 
PREVIOUS NEXT
Tagged: #bash #function #arguments
ADD COMMENT
Topic
Name
2+6 =