我有一条线,我想知道它内是否有任何嵌入的单引号字符.使用awk,我尝试了几种变体
badix = index($0,"\047") -- this does not find it
badix = index($0, "'") -- throws a fit
badix = index($0, "\'") -- throws a fit
badix = index($0, \') -- throws a fit
Run Code Online (Sandbox Code Playgroud)
这适用于Solaris 10上的awk,因此在这种情况下gawk解决方案不适用.
有什么建议?