欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

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
相关标签: bash