{
tmpfile=$(mktemp $(dirname "$1")/XXXXXX)
mv "$1" "$tmpfile" && mv "$2" "$1" && mv "$tmpfile" "$2"
}
吧代码加到~/.bashrc中,然后输入swap A B即可
sort -k 1,1 filea|awk 'BEGIN { first=1}
{if ($1==LAST)
{
result=result&$2
first=0
}
else if
{
if (first==0)
{
print result
result=$0
first=1
}
first=0
}
}
END { print result}' > fileb
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)