DEV Community

Discussion on: Shellscripting

Collapse
 
moopet profile image
Ben Sinclair

by convention, variable names should be all in uppercase.

A lot of scripts do that, so you could call it a convention, but generally you should only use ALL_CAPS_NAMES for environment variables or other stuff that's part of the shell's world. Variables local to scripts should be lower_snake_case to avoid collisions and hint that they're not going to have any effects outside the script.

Collapse
 
puritanic profile image
Darkø Tasevski

That sounds reasonable, thanks for the tip!