【发布时间】:2015-10-11 05:20:20
【问题描述】:
我正在尝试将纯文本密码添加到导出的用户表中的相应行。我有两个文件:
用户表
barry hash1
fred hash2
mary hash3
rich hash2
破解通行证
ptpass1 hash1
ptpass2 hash2
我希望输出看起来像:
组合表
barry hash1 ptpass1
fred hash2 ptpass2
mary hash3
rich hash2 ptpass2
我已经根据我找到的另一个条目尝试了以下代码,但这只会打印出匹配的行,而不是全部:
$ awk 'NR==FNR{a[$2]=$0; next} a[$2]>0{print a[$2],$1}' usertable crackpasstable > combinedtable
我想尝试打印出用户表中的所有行(希望按照原始顺序),如果我能够破解它们,只需在新列中添加匹配的密码。
谢谢
【问题讨论】:
标签: awk