Skip to content

Instantly share code, notes, and snippets.

@akiniwa
Last active December 27, 2015 15:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akiniwa/7350006 to your computer and use it in GitHub Desktop.
Save akiniwa/7350006 to your computer and use it in GitHub Desktop.
#!/bin/sh
awk '{printf("%s:%s %s %s %s\n", $1, $2, $1, $2, $3);}' file1.txt | sort > sort1
awk '{printf("%s:%s\n", $1, $2);}' file2.txt | sort > sort2
join -1 1 -2 1 -o 1.2,1.3,1.4 sort1 sort2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment