My code is
ip=$(awk -F, "IGNORECASE = 1; $4 ~ /$line/ {print $4}" $today-combined.csv | wc -l)
html=$(awk -F, "IGNORECASE = 1; $5 ~ /$line/ {print $5}" $today-combined.csv | wc -l)
when i do sh -x test.sh , i got this
++ awk -F, 'IGNORECASE = 1; ~ /eg/ {print }' 2021-01-16-combined.csv
++ wc -l
awk: cmd. line:1: IGNORECASE = 1; ~ /eg/ {print }
awk: cmd. line:1: ^ syntax error
+ ip=0
++ awk -F, 'IGNORECASE = 1; ~ /eg/ {print }' 2021-01-16-combined.csv
++ wc -l
awk: cmd. line:1: IGNORECASE = 1; ~ /eg/ {print }
awk: cmd. line:1: ^ syntax error
+ html=0
I am not sure where I am getting a syntax error.
I try that also
ip=$(awk -F, 'IGNORECASE = 1; $4 ~ /$line/ {print $4}' $today-combined.csv | wc -l)
html=$(awk -F, 'IGNORECASE = 1; $5 ~ /$line/ {print $5}' $today-combined.csv | wc -l)
but it wont pick $line value.
I try / before ' but no result for that too.
Any help?