diff options
| author | Zach DeCook <zach.decook@bettercarpeople.com> | 2022-10-17 11:57:51 -0400 |
|---|---|---|
| committer | Zach DeCook <zach.decook@bettercarpeople.com> | 2022-10-17 11:57:51 -0400 |
| commit | bef368a6363dadb025515a6a6d989d6cb7a3574f (patch) | |
| tree | f6d0e5b0bf373690ee8e3355406bac74cbbfbf1b /.local/bin/uniq: | |
| download | dotfiles-bef368a6363dadb025515a6a6d989d6cb7a3574f.tar.gz | |
work: initial commit
Diffstat (limited to '.local/bin/uniq:')
| -rwxr-xr-x | .local/bin/uniq: | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/.local/bin/uniq: b/.local/bin/uniq: new file mode 100755 index 0000000..50fcfa8 --- /dev/null +++ b/.local/bin/uniq: @@ -0,0 +1,16 @@ +#!/usr/bin/env python3 + +import fileinput +import sys + + +def main(): + old = '' + for line in fileinput.input(): + linenew = line.split(':')[0] + if old != linenew: + print(line, end='') + old = linenew + +if __name__ == '__main__': + sys.exit(main()) |
