#!/bin/bash if [ -z "$1" ]; then echo echo "Script calls Lout the required number of times in order to correctly" echo "resolve cross-references for the specified Lout document. You must" echo "run this script from the same directory as the given document!" echo echo "Usage: $0 []" echo echo "If is not specified it defaults to ." echo "This version generates a PostScript file format named .ps." echo exit fi # Comment this if you don't want to clear all compilation files in the running dir! rm -f *.ld *.li *.ldx COUNTER=1 OUTFILE="$2.ps" if [ -z "$2" ]; then OUTFILE="$1.ps" fi echo "Building $OUTFILE:" echo "Run $COUNTER" until [ `lout -o "$OUTFILE" "$1" 2>&1|grep "unresolved cross reference"|wc -l` = "0" ]; do let COUNTER+=1 echo "Run $COUNTER" done # Comment this if you don't want to clear all compilation files in the running dir! rm -f *.ld *.li *.ldx