shell程式設計例子(1),持續更新中
阿新 • • 發佈:2021-01-02
1.hello word
#!/bin/bash
echo "hello word"
2. 變數
#!/bin/bash
#變數
my_name="Mr.zhang"
echo $my_name
echo ${my_name}
#只讀變數
sex="man"
age="20"
readonly sex
sex="woman"
age="21"
echo $sex
echo $age
執行結果:
3. 刪除變數
#!/bin/bash #刪除變數 name="Mr.zhang" score="30" unset score echo $name echo $score
執行結果:
4.