我想打印一个以四位数字开头的文件中的所有行.我尝试了这个allredy但它不起作用:
cat data.txt | awk --posix '{ if ($1 ~ /^[0-9]{4}/) print $1}'
Run Code Online (Sandbox Code Playgroud)
没有生成输出
下一行打印所有以数字开头的lins:
cat data.txt | awk --posix '{ if ($1 ~ /^[0-9]/) print $1}'
Run Code Online (Sandbox Code Playgroud) awk ×1