Difference between
modified post 16b43bb by Anonymous on Fri 19th Jul 2024 00:01
original post cecb by Anonymous on Thu 18th Jul 2024 23:38
Download diff
Show
old version |
new version |
both versions
| 1 | 1 | #!/bin/ksh93 | |
| 2 | 2 | ||
| 3 | 3 | # | |
| 4 | 4 | # make_numtree1.ksh93 - build makefile to generate number sequence | |
| 5 | + | # The resulting Makefile is intended to be used with $ make -j128 all # | |
| 5 | 7 | # | |
| 8 | + | # Written by Roland Mainz <roland.mainz@nrubsig.org> | |
| 6 | 10 | ||
| 7 | 11 | function make_number_seq | |
| 8 | 12 | { | |
| 13 | + | # set -o nounset | |
| 9 | 15 | nameref out_maketarget=$1 | |
| 10 | 16 | integer start_i=$2 | |
| 11 | 17 | integer stop_i=$3 | |
| 12 | 18 | integer i | |
| 13 | 19 | typeset -a make_targets | |
| 14 | 20 | ||
| 21 | + | if (( (stop_i - start_i) > 100 ; then | |
| 15 | 26 | for ((i=start_i ; i < stop_i ; i++ )) ; do | |
| 16 | 27 | printf 'i_%d:\n' i | |
| 17 | 28 | printf '\tprintf "%d\\n" >"i_%d"\n' i i | |
| 18 | 29 | make_targets+=( "i_$i" ) | |
| 19 | 30 | done | |
| 31 | + | fi | |
| 20 | 32 | ||
| 21 | 33 | out_maketarget="i_${start_i}_${stop_i}" | |
| 22 | 34 | printf 'i_%d_%d: %s\n' start_i stop_i "${make_targets[*]}" | |
| 23 | 35 | ||
| 24 | 36 | printf '\tcat ' | |
| 25 | 37 | printf '%q ' "${make_targets[@]}" | |
| 26 | 38 | printf ' >"%s"\n' "$out_maketarget" | |
| 27 | 39 | ||
| 40 | + | return 0 |
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