Bash Variable: define and usage: difference between $NAME and ${NAME}
程序员文章站
2022-06-01 17:23:32
...
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
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
上一篇: 红薯的禁忌是什么
下一篇: Oracle更新语句