- 论坛徽章:
- 32
|
- [root@localhost ~]# head test/*
- ==> test/a <==
- 1
- 2
- 3
- <SERVERID>
- 4
- ==> test/b <==
- 5555
- <SERVERID>
- <SERVER_NAME> fdsaf
- ==> test/c <==
- server_name=<server_name>
- [root@localhost ~]# cat t
- <SERVERID> 1
- <SERVER_NAME> aaaaa
- [root@localhost ~]# find /root/test -type f | xargs awk -vIGNORECASE=1 'NR==FNR{a[$1]=$2;next}{for(i in a)gsub(i,a[i])}{print > FILENAME}' t
- [root@localhost ~]# head test/*
- ==> test/a <==
- 1
- 2
- 3
- 1
- 4
- ==> test/b <==
- 5555
- 1
- aaaaa fdsaf
- ==> test/c <==
- server_name=aaaaa
- [root@localhost ~]#
复制代码 效率嘛,我没大量数据可测~ |
|