gawk not working with single quotes
Brought to you by:
syring
gawk is not working when the pattern is given in single
quotes whereas working with double quotes.
For example:
gawk '{ sum += $1 }; END { print sum }' file
gives output:
gawk: cmd. line:1: '{
gawk: cmd. line:1: ^ invalid char ''' in expression
whereas
gawk "{ sum += $1 }; END { print sum }" file
works fine.
Logged In: NO
It's not gawk's fault, it's the shell's (if at all). See my
response to your grep-related question.