shell 只读变量

 

test.sh:

#!/bin/bash
myUrl="http://www.google.com"
readonly myUrl
myUrl="http://www.runoob.com"

输出

bogon:Desktop macname$ ./test.sh 
./test.sh: line 4: myUrl: readonly variable

 

参考:

https://www.runoob.com/linux/linux-shell-variable.html

 

posted @ 2019-08-23 23:01  anobscureretreat  阅读(447)  评论(0)    收藏  举报