File contains compiler generated warnings
warnings.txt(with 8 lines)
Line1 "/Project/user/XYZ/gsoap/gsoap-2.8.9/gsoap/stdsoap2.cpp", line 1657: error #4296-D: arithmetic operation on boolean type
Line2{ return soap->count - soap->buflen + soap->bufidx - (soap->ahead != 0);
Line3
Line4
Line5 "/Project/user/XYZ/gsoap/gsoap-2.8.9/gsoap/stdsoap2.cpp", line 4136: warning #3348-D: declaration hides variable "err" (declared at line 3
Line6 700)
Line7 { int err = SSL_get_error(soap->ssl, r);
Line8 ^
I want to read this file line by line using awk as while loop takes much time to process
Two ways i tried:
for line in `awk '{print $0}' warnings.txt`
do
echo $line
done
and,
for line in `awk '{BEGIN{ORS="\n";}{print $0}' warnings.txt`
do
echo $line
done
Expected Output:
Same as above(i.e. content of file line by line)
Line1 "/Project/user/XYZ/gsoap/gsoap-2.8.9/gsoap/stdsoap2.cpp", line 1657: error #4296-D: arithmetic operation on boolean type
Line2{ return soap->count - soap->buflen + soap->bufidx - (soap->ahead != 0);
Line3
Line4
Line5 "/Project/user/XYZ/gsoap/gsoap-2.8.9/gsoap/stdsoap2.cpp", line 4136: warning #3348-D: declaration hides variable "err" (declared at line 3
Line6 700)
Line7 { int err = SSL_get_error(soap->ssl, r);
Line8 ^
My output:
"/Project/user/XYZ/gsoap/gsoap-2.8.9/gsoap/stdsoap2.cpp",
line
1657:
error
#4296-D:
arithmetic
operation
on
boolean
type
{
return
soap->count
-
soap->buflen
+
soap->bufidx
-
(soap->ahead
!=
0);
"/Project/user/XYZ/gsoap/gsoap-2.8.9/gsoap/stdsoap2.cpp",
line
4136:
warning
#3348-D:
declaration
hides
variable
"err"
(declared
at
line
3
700)
{
int
err
=
SSL_get_error(soap->ssl,
r);
^
Thanks