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

exit 0

 

#!/bin/bash
message=Hello
Hello=Goodbye
Hello=GOODBYE2
Hello=goodbye3
echo "${!message}"
posted @ 2010-05-18 10:52  waynechen  阅读(364)  评论(0编辑  收藏  举报