Hi folks,
I am self-learning as I can
I have a script that has read a file into an array.
I can read out each line in the array with the code:
for INDEX in {0..$LENGTH} ## $LENGTH was determined at the read in
do
echo "${data[$INDEX]}"
done
What I need to do is test the first char of each line so I can branch out for processing.
In essence, the psudo-code looks like this:
for INDEX in {0..$LENGTH} ## $LENGTH was determined at the read in
do
If the first char of "${data[$INDEX]}" = " " then skip
or
If the first char of "${data[$INDEX]}" = "!" then skip
else
Capture the current line into a second array to be referenced later in
the script
done
But I've searching not seen anything I can understand
Thanks for any help