bash 函数
#!/bin/bash
func()
{
echo "$1"
}
echo "fist call to function: no arg passed."
echo "see if command-line arg is seen."
func
echo
echo "second call to function: command-line arg passed explicitly."
func $1
message=Hello
Hello=Goodbye
Hello=GOODBYE2
Hello=goodbye3
echo "${!message}"
func()
{
echo "$1"
}
echo "fist call to function: no arg passed."
echo "see if command-line arg is seen."
func
echo
echo "second call to function: command-line arg passed explicitly."
func $1
exit 0
#!/bin/bash
message=Hello
Hello=Goodbye
Hello=GOODBYE2
Hello=goodbye3
echo "${!message}"