Skip to content

Commit

Permalink
+ add uniq-lines command
Browse files Browse the repository at this point in the history
  • Loading branch information
zavakid authored and oldratlee committed Feb 19, 2021
1 parent 273fb91 commit 0a4212d
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 0a4212d

Please sign in to comment.