title: Bash local AND readonly variable
body: <p>I like to organize my code with functions, as I am using function I like to use <code>local</code> variables also. As much as possible I use <code>read-only</code> variables, so if I make any mistake inside my code it will be easily noticed.</p>
  
  <p>But I have been using it wrong for a long time. So I decided to write it to share my experience.</p>
  
  <p>How to define <code>local</code> AND <code>read-only</code> inside bash function? (See the answer and explanation below).</p>