1. 程式人生 > >shell script中的 ${a}和$a有什麼區別?

shell script中的 ${a}和$a有什麼區別?

        最近碰到這個問題, 差點踩坑, 來記錄一下, 看看:

#!/bin/bash

echo $9 $10
echo $9 ${10}
       看一下執行結果:
xxxxxx$ ./a.sh a1 a2 a3 a4 a5 a6 a7 a8 a9 hello  
a9 a10
a9 hello

       可見, 還是有差別的, 我個人強烈建議一直用${a},  可讀性也更好啊。