basic.sh 505 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/sh
  2. OnExit()
  3. {
  4. trap "trap - TERM && $*" INT TERM EXIT
  5. }
  6. tempdir=$(mktemp -d)
  7. OnExit "rm -rf $tempdir"
  8. echo
  9. echo Testing in $tempdir
  10. testfile="$tempdir/test.file"
  11. original="$tempdir/original.file"
  12. echo 1234567890abcdefghijklmnopqrstuvwxyz > "$testfile"
  13. out/fshred -s 3 "$testfile"
  14. mv "$testfile" "$original"
  15. out/fglue "$tempdir/test.info"
  16. echo
  17. echo glued file:
  18. cut -c1-200 "$testfile"
  19. echo
  20. echo original file:
  21. cut -c1-200 "$original"
  22. echo
  23. echo difference:
  24. diff "$testfile" "$original"
  25. echo