I have a bash script which seems to lose the value of the readonly constant after the first time thru the for-in loop. For example:#!/bin/bashreadonly DIR=./groups/for output in ${array[@]}do   catstring+=$DIR$output doneprintf $catstringcat $catstring > outputfileThe array has a bunch of names in it like: file1 file2 file3, etc.The output from the printf statement is ./groups/file1 file2 file3. What I'm expecting is ./groups/file1 ./groups/file2 ./groups/file3.Why is bash losing the value of $DIR after the first time thru the for-in loop?
bash script loses readonly value after first time thru loop
linux;bash;scripting