awk读取文件里面的某个字段

来源:互联网 发布:php时间月份差 编辑:程序博客网 时间:2024/04/28 09:07

#!/bin/bash

test=`awk '$1~/^wanglong$/{print $2}'  file.txt

0 0