DEV Community

Discussion on: Writing Bash Scripts Like A Pro - Part 1 - Styling Guide

bence42 profile image
Bence Szabo

Nice! I'm happy to see that somebody agrees that bash is still relevant and is worth to learn.
Will you cover the readonly "qualifier"?

unfor19 profile image
Meir Gabay Author

I'm using Bash across most of my projects, so for me it's definitely here to stay :)

Truth be told, I haven't used readonly in any script, ever. I guess it's best practice to create immutable variables with:

# Output
# bash: VAR_NAME: readonly variable
Enter fullscreen mode Exit fullscreen mode

Looks cool and easy to implement, I might adopt it in my future scripts.