案例一: #!/bin/bash hello () { echo "hahahah" } hello 执行函数,结果为:hahaha 案例二: #!/bin/bash funWithReturn() { echo "the function is to get the sum of two number" read -p "input first number" num1 read -p "input second number" num2 echo "the two number are $num1 and $num2 !