pastebin - collaborative debugging tool
nrubsig.kpaste.net RSS

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

    
11
#!/bin/ksh93
22
33
#
44
# make_numtree1.ksh93 - build makefile to generate number sequence
5+
# The resulting Makefile is intended to be used with $ make -j128 all #
57
#
8+
# Written by Roland Mainz <roland.mainz@nrubsig.org>
610
711
function make_number_seq
812
{
13+
#	set -o nounset
915
	nameref out_maketarget=$1
1016
	integer start_i=$2
1117
	integer stop_i=$3
1218
	integer i
1319
	typeset -a make_targets
1420
21+
	if (( (stop_i - start_i) > 100 ; then
1526
	for ((i=start_i ; i < stop_i ; i++ )) ; do
1627
		printf 'i_%d:\n' i
1728
		printf '\tprintf "%d\\n" >"i_%d"\n' i i
1829
		make_targets+=( "i_$i" )
1930
	done
31+
	fi
2032
2133
	out_maketarget="i_${start_i}_${stop_i}"
2234
	printf 'i_%d_%d: %s\n' start_i stop_i "${make_targets[*]}"
2335
2436
	printf '\tcat '
2537
	printf '%q ' "${make_targets[@]}"
2638
	printf ' >"%s"\n' "$out_maketarget"
2739
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.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at