Correct Bash and shell script variable capitalization

前端 未结 7 1860
太阳男子
太阳男子 2020-11-21 22:54

I run across many shell scripts with variables in all caps, and I\'ve always thought that there is a severe misunderstanding with that. My understanding is that, by convent

相关标签:
7条回答
  • 2020-11-21 23:43

    i tend use ALL_CAPS both for environment and global variables. of course, in Bash there's no real variable scope, so there's a good portion of variables used as globals (mostly settings and state tracking), and relatively few 'locals' (counters, iterators, partly-constructed strings, and temporaries)

    0 讨论(0)
提交回复
热议问题