Hi,
I'm trying to write a routine to parse a file that contains data that will be read
into arrays. The file is composed of labels to identify data types and arbitrary
lines of data with the usual remarks and empty new lines as is common with
config files.
The initial pass is built as so:
while read line; do
case $line in
'\n' ) continue;;
'#'* ) continue;;
'['*']' ) do_label;;
* ) do_error;;
esac
done < $filename
Unfortunately, I seem to be having a problem trying to get the case statement to
recognise a new line, falling through to default. After searching, I was left
unenlightened. I tried inserting '^' and '$' before and after, inside and outside '\n'
but still no success. I also tried using '\f' and '\r' just in case it was a text editor
misinterpretation.
However, I did find alternative command line solutions, but I would prefer to keep
it purely bash and regex if possible.
Feedback would be appreciated.
A.