- #!/bin/ksh93
- #
- # makeseqtree1 - build a POSIX Makefile which generates the
- # number sequence 1...n in small chunks
- #
- # This is intended to be a filesystem test
- #
- #
- # Written by Roland Mainz <roland.mainz@nrubsig.org>
- #
- #
- # leaf function
- # ToDo: write function for branches which calls "make_seq_tree_leaf"
- function make_seq_tree_leaf
- {
- set -o nounset
- compound c
- typeset c.fp=$1 # prefix
- integer c.seqstart=$2
- integer c.seqincrement=$3
- integer c.seqend=$4
- integer c.i
- integer c.s
- integer c.e
- typeset c.cat_files=''
- for (( c.i=c.seqstart ; c.i < c.seqend ; )) ; do
- (( c.s=c.i , c.e=c.i+c.seqincrement ))
- printf '%sseq%d_%d:\n' "${c.fp}" c.s c.e
- printf '\tseq %d 1 %d >"%sseq%d_%d"\n' c.s c.e "${c.fp}" c.s c.e
- c.cat_files+="$(printf ' %sseq%d_%d' "${c.fp}" c.s c.e)"
- (( c.i=c.e ))
- done
- printf '%s: %s\n' "${c.fp}" "${c.cat_files}"
- printf '\tcat %s\n' "${c.cat_files}"
- return 0
- }
- make_seq_tree_leaf 'xxx0_50' 0 10 50
- make_seq_tree_leaf 'xxx51_100' 1 10 100
- printf 'all: xxx0_50 xxx51_100\n'
- # EOF.
makeseqtree1 - build a POSIX Makefile which generates the number sequence 1...n in small chunks
Posted by Anonymous on Wed 28th Feb 2024 15:08
raw | new post
modification of post by Anonymous (view diff)
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.