如何在我的bash shell中打印变量'num'

zjm*_*126 1 linux bash shell ubuntu

这是我的代码:

num=2
echo "this is the $numnd"
Run Code Online (Sandbox Code Playgroud)

它显示:

this is the
Run Code Online (Sandbox Code Playgroud)

我能做什么 ,

谢谢

fre*_*eit 8

使用大括号,如下所示:

num=2
echo "this is the ${num}nd"
Run Code Online (Sandbox Code Playgroud)

输出:

this is the 2nd
Run Code Online (Sandbox Code Playgroud)