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

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-23
  • 2022-01-17
  • 2021-12-18
  • 2021-08-05
猜你喜欢
  • 2021-07-04
  • 2021-12-18
  • 2021-07-01
  • 2021-12-05
相关资源
相似解决方案