Escaping backslash in AWK
问题 I'm trying to understand why the command below doesn't work (output is empty): echo 'aaa\tbbb' | awk -F '\\t' '{print $2}' I would expect the output to be 'bbb'. Interestingly this works (output is 'bbb'): echo 'aaa\tbbb' | awk -F 't' '{print $2}' And this works as well (ouptut is 'tbbb'): echo 'aaa\tbbb' | awk -F '\\' '{print $2}' It looks as if \\\t is read as backslash followed by tab instead of escaped backslash followed by t . Is there a proper way to write this command? 回答1: You need to