Im using 'bash' shell and executing below 'awk' command on a file with records of file separated with number of different chars like Brackets, Colons, Parentheses as below sample record
...(field#13[field#14:]]:filed#18[filed#19)[...
However when I'm escaping "][" with single escape '\', awk command failing and I must double escape '\\' Brackets only to get my expected result, how does it needs to use double escape Brackets (in 'csh' shell it's same)?
awk -F"[\\[\\]:)(]" '{print $18}' inFile
filed#18
also please note this, that I know for all I can escape them with double escape '\\' like below, I just want to know why for Brackets this is mandatory?
awk -F"[\\[\\]\\:\\)\\(]" '{print $18}' inFile
filed#18
even using signle escape gives warning (except for Brackets), but still command execeute and result coming, thanks
awk -F '[\\[\\]\:\)\(]' '{print $18}' inFile
awk: warning: escape sequence `\:' treated as plain `:'
awk: warning: escape sequence `\)' treated as plain `)'
awk: warning: escape sequence `\(' treated as plain `('
filed#18