Difference between
modified post 7ae by Anonymous on Wed 28th Feb 2024 15:08
original post aa00dd04a by Anonymous on Wed 28th Feb 2024 15:00
Download diff
Show
old version |
new version |
both versions
| 1 | 1 | #!/bin/ksh93 | |
| 2 | 2 | ||
| 3 | 3 | # | |
| 4 | 4 | # makeseqtree1 - build a POSIX Makefile which generates the | |
| 5 | 5 | # number sequence 1...n in small chunks | |
| 6 | 6 | # | |
| 7 | - | # This is intenended to be a filesystem test | |
| 7 | + | # This is intended to be a filesystem test | |
| 8 | 8 | # | |
| 9 | 9 | ||
| 10 | 10 | # | |
| 11 | 11 | # Written by Roland Mainz <roland.mainz@nrubsig.org> | |
| 12 | 12 | # | |
| 13 | 13 | ||
| 14 | 14 | # | |
| 15 | 15 | ||
| 16 | 16 | # leaf function | |
| 17 | 17 | # ToDo: write function for branches which calls "make_seq_tree_leaf" | |
| 18 | 18 | function make_seq_tree_leaf | |
| 19 | 19 | { | |
| 20 | 20 | set -o nounset | |
| 21 | 21 | compound c | |
| 22 | 22 | ||
| 23 | 23 | typeset c.fp=$1 # prefix | |
| 24 | 24 | integer c.seqstart=$2 | |
| 25 | 25 | integer c.seqincrement=$3 | |
| 26 | 26 | integer c.seqend=$4 | |
| 27 | 27 | ||
| 28 | 28 | integer c.i | |
| 29 | 29 | integer c.s | |
| 30 | 30 | integer c.e | |
| 31 | 31 | typeset c.cat_files='' | |
| 32 | 32 | ||
| 33 | 33 | for (( c.i=c.seqstart ; c.i < c.seqend ; )) ; do | |
| 34 | 34 | (( c.s=c.i , c.e=c.i+c.seqincrement )) | |
| 35 | 35 | printf '%sseq%d_%d:\n' "${c.fp}" c.s c.e | |
| 36 | 36 | printf '\tseq %d 1 %d >"%sseq%d_%d"\n' c.s c.e "${c.fp}" c.s c.e | |
| 37 | 37 | c.cat_files+="$(printf ' %sseq%d_%d' "${c.fp}" c.s c.e)" | |
| 38 | 38 | (( c.i=c.e )) | |
| 39 | 39 | done | |
| 40 | 40 | ||
| 41 | 41 | printf '%s: %s\n' "${c.fp}" "${c.cat_files}" | |
| 42 | 42 | printf '\tcat %s\n' "${c.cat_files}" | |
| 43 | 43 | ||
| 44 | 44 | return 0 | |
| 45 | 45 | } | |
| 46 | 46 | ||
| 47 | - | make_seq_tree_leaf 'xxx1' 0 10 100 | |
| 47 | + | make_seq_tree_leaf 'xxx0_50' 0 10 50 | |
| 48 | + | make_seq_tree_leaf 'xxx51_100' 1 10 100 | |
| 48 | 49 | ||
| 49 | - | printf 'all: xxx1\n' | |
| 50 | + | printf 'all: xxx0_50 xxx51_100\n' | |
| 50 | 51 | ||
| 51 | 52 | # EOF. | |
| 52 | 53 |
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.
nrubsig.kpaste.net RSS