logo

utils-std

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

yes.t (569B)


  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 yes)" = "$TESTDIR/../cmd/yes"
  6. $ yes | head -n 3
  7. y
  8. y
  9. y
  10. $ yes foo | head -n 4
  11. foo
  12. foo
  13. foo
  14. foo
  15. $ yes "" | head -n 5
  16. $ yes foo '' | head -n 6
  17. foo
  18. foo
  19. foo
  20. foo
  21. foo
  22. foo
  23. $ yes "$(printf 'foo\nbar')" | head -n 4
  24. foo
  25. bar
  26. foo
  27. bar
  28. $ yes 2>&1 >/dev/full
  29. yes: Write Error: No space left on device
  30. [1]