logo

utils-std

Collection of commonly available Unix tools git clone https://anongit.hacktivis.me/git/utils-std.git/

uniq_posix.t (743B)


  1. #!/usr/bin/env cram
  2. # SPDX-FileCopyrightText: 2017 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
  3. # SPDX-License-Identifier: MPL-2.0
  4. $ export PATH="$TESTDIR/../cmd:$PATH"
  5. $ test "$(command -v uniq)" = "$TESTDIR/../cmd/uniq"
  6. $ uniq -c -f 1 "${TESTDIR}/uniq_0I.txt"
  7. \s*1 #01 foo0 bar0 foo1 bar1 (re)
  8. \s*1 #02 bar0 foo1 bar1 foo1 (re)
  9. \s*1 #03 foo0 bar0 foo1 bar1 (re)
  10. \s*1 #04 (re)
  11. \s*2 #05 foo0 bar0 foo1 bar1 (re)
  12. \s*1 #07 bar0 foo1 bar1 foo0 (re)
  13. $ uniq -d -f 1 "${TESTDIR}/uniq_0I.txt"
  14. #05 foo0 bar0 foo1 bar1
  15. $ uniq -u -f 1 "${TESTDIR}/uniq_0I.txt"
  16. #01 foo0 bar0 foo1 bar1
  17. #02 bar0 foo1 bar1 foo1
  18. #03 foo0 bar0 foo1 bar1
  19. #04
  20. #07 bar0 foo1 bar1 foo0
  21. $ uniq -d -s 2 "${TESTDIR}/uniq_0I.txt"