Bash Variable: define and usage: difference between $NAME and ${NAME}

Variable: define and usage: difference between $NAME and ${NAME}
1, Define:
NAME="Zara Ali"

2, Use:
Input below in test.ksh

NAME="Zara Ali"
AGE=13
echo $NAME
$ Zara Ali

#use ${NAME} can apend strings and other variable
echo ${NAME}_IS
$ Zara Ali_IS

echo ${NAME}${AGE}
$ Zara Ali13

#print the first parametor
echo ${1}
$ Hello

go to terminal, execute
$ ./test.ksh Hello

猜你喜欢

转载自bonnietang.iteye.com/blog/2359820