- #!/bin/ksh93
- #
- # makeseqtree1 - build a POSIX Makefile which generates the
- # number sequence 1...n in small chunks
- #
- # This is intenended to be a filesystem test
- #
- #
- # Written by Roland Mainz <roland.mainz@nrubsig.org>
- #
- #
- # sequence 1...200
- set -o nounset
- compound c
- integer c.i
- integer c.s
- integer c.e
- typeset c.cat_files=''
- typeset c.targets=''
- integer c.chunk_i=0
- typeset c.all_files=''
- for ((c.i=0 ; c.i < 2000 ; )) ; do
- ((c.s=c.i , c.e=c.i+20))
- printf 'make_seq%d_%d:\n' c.s c.e
- printf '\tseq %d 1 %d >"seq%d_%d"\n' c.s c.e c.s c.e
- c.targets+="$(printf ' make_seq%d_%d' c.s c.e)"
- c.cat_files+="$(printf ' "seq%d_%d"' c.s c.e)"
- ((c.i=c.e ))
- if (( (++c.chunk_i % 5) == 0 )) ; then
- printf 'chunk%d: %s\n' c.chunk_i "${c.targets}"
- printf '\tcat %s >"chunk%d"\n' "${c.cat_files}" c.chunk_i
- c.all_files+="$(printf ' chunk%d' c.chunk_i)"
- c.targets=''
- c.cat_files=''
- fi
- done
- printf 'all: %s\n' "${c.all_files}"
- printf '\tcat %s\n' "${c.all_files}"
- # EOF.
makeseqtree1 - build a POSIX Makefile which generates the number sequence 1...n in small chunks
Posted by Anonymous on Wed 28th Feb 2024 14:33
raw | new post
view followups (newest first): makeseqtree1 - build a POSIX Makefile which generates the number sequence 1...n in small chunks by Anonymous
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.