awk管道导致'无法打开文件'错误

时间:2017-11-10 12:52:47

标签: bash awk

鉴于包含"txt_to_be_ext",sometext("txt_to_be_ext", some_more_text, "test")的失败,我有一个脚本,它会提取"txt_to_be_ext"并将其附加到行"txt_to_be_ext","txt_to_be_ext",sometext("txt_to_be_ext", some_more_text, "test")的前面。

脚本如下所示:

awk '{match($0,/^.*\(("[^"]+"),*/,a);$0=a[1]","$0}1' %file% | tail -n +3

我正在尝试将其传递到tail -n +3以摆脱前几行,因为它们包含已执行脚本的文件路径,但在执行该脚本时,我得到:awk: cmd. line:1: fatal: cannot open file '|' for reading ... < / p>

是什么给出了?

0 个答案:

没有答案