Hi,
I am trying to use forward slash in awk. While running the command through console, its working fine but not working while running it through shell script.
find . -name "*" -ctime -6 | xargs cat | grep -E -v ^fileName\|^\([0-9]\) | awk -v DATE="${CURR_DATE}" -v DATE_LOG="$DATE_SYS" '
BEGIN {
FS = ";"
OFS = ";"
CONVFMT = "%.9g"
OFMT = "%.9g"
}
{
clef = "2-PARSING_ERROR;" DATE ";" DATE_LOG ";"
substr ( $0, 12, 8) ";" substr ( $0, 5, 6 ) ";NS;N/A;" $3
tab[clef]++
}
END {
for (clef in tab)
{
print tab[clef],clef
}
}
'
Is the problem because my console shell is bash and through script it is ksh?
How to use the forward slash in awk? I tried escaping it with 2 backslashes , also quoting it but none worked.
Please help.