pastebin - collaborative debugging tool
nrubsig.kpaste.net RSS


append I/O test
Posted by Anonymous on Fri 25th Apr 2025 20:17
raw | new post

  1. #!/usr/bin/ksh93
  2.  
  3. #
  4. # append I/O test
  5. #
  6.  
  7. rm -f 'appendtest1.tmp1' 'appendtest1.tmp2'
  8.  
  9. typeset l='############################################'
  10. l+="$l"
  11. l+="$l"
  12. l+="$l"
  13. l+="$l"
  14. l+="$l"
  15. l+="$l"
  16. l+="$l"
  17. l+="$l"
  18. l+="$l"
  19.  
  20. redirect {n}>>'appendtest1.tmp2'
  21. integer i
  22. for ((i=6000 ; i > 0 ; i-- )) ; do
  23.     (ulimit -c 0 ; print -f '%d\t%s\n' "$i" "${l:0:$i%8192}" >>'appendtest1.tmp1')
  24. done
  25. ls -l 'appendtest1.tmp1'
  26.  
  27. for ((i=6000 ; i > 0 ; i-- )) ; do
  28.     print -u$n -f '%d\t%s\n' "$i" "${l:0:$i%8192}"
  29. done
  30. ls -l 'appendtest1.tmp2'
  31.  
  32. sync
  33.  
  34.  
  35. diff -u 'appendtest1.tmp1' 'appendtest1.tmp2'
  36. #

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at