Skip to content

Commit

Permalink
Merge pull request oldratlee#92 from zavakid/dev-2.x
Browse files Browse the repository at this point in the history
add uniq-lines command
  • Loading branch information
oldratlee committed Feb 19, 2021
2 parents 273fb91 + 0a4212d commit dad2bee
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions bin/uniq-lines
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash
# @Function
# print uniq line keep order, no sorting required

outputUniqLines() {
awk '{
s[$0]++
}
END {
for(v in s) {
if (s[v] == 1) {
print v
}
}
}'
}

cat "$@" | outputUniqLines

0 comments on commit dad2bee

Please sign in to comment.