Read-only shell variables

 

test.sh:

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

Export

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

 

reference:

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

 

Guess you like

Origin www.cnblogs.com/sea-stream/p/11403088.html