Difference between
modified post aa00dd04a by Anonymous on Wed 28th Feb 2024 15:00
original post 03b by Anonymous on Wed 28th Feb 2024 14:33
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 | 7 | # This is intenended 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 | - | # sequence 1...200 | |
| 16 | + | # leaf function | |
| 17 | + | # ToDo: write function for branches which calls "make_seq_tree_leaf" | |
| 18 | 20 | set -o nounset | |
| 20 | 21 | compound c | |
| 22 | + | ||
| 21 | 28 | integer c.i | |
| 22 | 29 | integer c.s | |
| 23 | 30 | integer c.e | |
| 24 | 31 | typeset c.cat_files='' | |
| 28 | 32 | ||
| 29 | - | for ((c.i=0 ; c.i < 2000 ; )) ; do | |
| 33 | + | for (( c.i=c.seqstart ; c.i < c.seqend ; )) ; do | |
| 34 | + | (( c.s=c.i , c.e=c.i+c.seqincrement )) | |
| 30 | 40 | ||
| 31 | - | ((c.s=c.i , c.e=c.i+20)) | |
| 41 | + | printf '%s: %s\n' "${c.fp}" "${c.cat_files}" | |
| 32 | - | printf 'make_seq%d_%d:\n' c.s c.e | |
| 42 | + | printf '\tcat %s\n' "${c.cat_files}" | |
| 37 | 43 | ||
| 38 | - | if (( (++c.chunk_i % 5) == 0 )) ; then | |
| 44 | + | return 0 | |
| 39 | - | printf 'chunk%d: %s\n' c.chunk_i "${c.targets}" | |
| 45 | + | } | |
| 45 | 46 | ||
| 46 | - | done | |
| 47 | + | make_seq_tree_leaf 'xxx1' 0 10 100 | |
| 47 | 48 | ||
| 48 | - | printf 'all: %s\n' "${c.all_files}" | |
| 49 | + | printf 'all: xxx1\n' | |
| 50 | 50 | ||
| 51 | 51 | # EOF. | |
| 52 | 52 |
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