Bash local AND readonly variable

Viewed 10686

I like to organize my code with functions, as I am using function I like to use local variables also. As much as possible I use read-only variables, so if I make any mistake inside my code it will be easily noticed.

But I have been using it wrong for a long time. So I decided to write it to share my experience.

How to define local AND read-only inside bash function? (See the answer and explanation below).

2 Answers
Related