How to parse line by line from dmesg
command?, i try using a while
and read
:
while read -r L; do
echo "line: ${L}";
done < <(dmesg -c --level=err)
But can not echo the lines. I try using:
LINES=$(dmesg -c --level=err);
while read -r L; do
echo "line: ${L}";
done <<< "$LINES"
But echo only a one line without content.
When call dmesg -c --level=err
have a 5 lines with content.
How to parse this?