This is an example of how you can run a function with parameters in Bash. This function, at the beginning will ask for the first input which is the “name” and then it will ask for the same input which is the “age” and it will convert the age in years to days.
# global variable USERNAME=$1 myFunc(){ echo "Hello $USERNAME, You are $1 Years Old." echo "That makes you approximately `expr $1 \* 365` days old" } echo "Enter Your Age: " read USERAGE myFunc $USERAGE