Files
mercury/tools/assemble
Fergus Henderson 5ae846242a Replace shift 3' with shift; shift; shift', since the former
Estimated hours taken: 0.1

tools/assemble:
	Replace `shift 3' with `shift; shift; shift', since the former
	doesn't work on ULTRIX.
1996-05-13 06:15:56 +00:00

33 lines
762 B
Bash
Executable File

#!/bin/sh
# Assemble a C source file from its component parts.
# The parts are in stage2.{ok,bad}/$problemdir/$module.c.part.{1,2,...$count}.
# Assemble uses the parts from stage2.bad for the parts whose numbers are
# listed in $tested, and the parts from stage2.ok for the other parts.
# The patchwork file will be put in stage2/$problemdir/$module.c.
if test $# -le 3
then
echo "Usage: assemble problemdir module count testedparts ..."
exit 1
fi
problemdir="$1"
module="$2"
cnt="$3"
shift; shift; shift
tested="$@"
cat /dev/null > stage2/$problemdir/$module.c
i=0
while test $i -le $cnt
do
if appears $i $tested
then
which=bad
else
which=ok
fi
cat stage2.$which/$problemdir/$module.c.part.$i >> stage2/$problemdir/$module.c
i=`expr $i + 1`
done