awk常用命令

来源:互联网 发布:网络电影里的女主角 编辑:程序博客网 时间:2024/05/16 01:34

使用外部变量

注册并充值

userList=`cat /tmp/reg.txt | awk '{printf("%s,",$0)}' `;cat /tmp/pay.txt  | awk -v userList="$userList" ' BEGIN{ count=0; split(userList,userListTmpArr,","); for(i in userListTmpArr) { userName=userListTmpArr[i]; if(userName) { userListArr[userName] = 1; } } } { //代码} END {//代码}'