- 论坛徽章:
- 0
|
本帖最后由 coollinn 于 2010-04-23 14:13 编辑
回复 9# Shell_HAT
linux bash为何没有输出结果
laptop:~/test$ more *txt
::::::::::::::
1.txt
::::::::::::::
asdf:123:321
123:abc:1231
::::::::::::::
2.txt
::::::::::::::
asdf:asdfafdasdfadf
laptop:~/test$ awk -F: 'ARGIND==1{a[$1]=$0}ARGIND==2&&a[$1]{print a[$1],$0}' 1.txt 2.txt
laptop:~/test$
同样的shell 在solairs bash下报错:
root@X4150 # more *.txt
::::::::::::::
1.txt
::::::::::::::
asdf:123:321
123:abc:1231
::::::::::::::
2.txt
::::::::::::::
asdf:asdfafdasdfadf
root@X4150 # awk -F: 'ARGIND==1{a[$1]=$0}ARGIND==2&&a[$1]{print a[$1],$0}' 1.txt 2.txt
awk: syntax error near line 1
awk: bailing out near line 1
root@X4150 # |
|