gawk

5年以前  |  阅读数:475 次  |  编程语言:Shell 
#!/bin/bash

BEGIN {
print "The latest list of users and shells"
print "Userid   Shell"
print "------   -----"
FS=":"
}

{
print $1 "  " $7
}

END {
print "This concludes the listing"
}

#执行gawk命令截取/etc/passwd输出
#gawk -f gawk.sh /etc/passwd

Copyright© 2013-2020

All Rights Reserved 京ICP备2023019179号-8