001、
[root@pc1 test1]# ls a.txt [root@pc1 test1]# a=4 [root@pc1 test1]# cat a.txt 1 [root@pc1 test1]# awk '{for(i = 1; i <= "'$a'"; i++) print "xx"}' a.txt xx xx xx xx
。
001、
[root@pc1 test1]# ls a.txt [root@pc1 test1]# a=4 [root@pc1 test1]# cat a.txt 1 [root@pc1 test1]# awk '{for(i = 1; i <= "'$a'"; i++) print "xx"}' a.txt xx xx xx xx
。