I have a program that counts lines containing alphanumeric words. For example:
this is line1
this is line
1234
this is line4
The answer is 2.
count=0
while IFS= read -r line
do
if [[ $line =~ [[:digit:]] ]];
then
if [[ $line =~ [a-zA-Z] ]];
then
count=$((count+1))
fi
fi
echo "$( cat $1 )"
done <<< $( cat $1 )
echo "Count: $count"
It works but I don't understand it. What does done <<< $( cat $1 )
do?