|
|
BSD 4.3
: 'Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. '
: '$Header: /var/lib/cvsd/repos/CSRG/43BSD/contrib/B/src/bint/Change,v 1.1.1.1 2018/04/24 16:12:54 root Exp $'
: 'Change error messages in limited number of files'
case $1 in
[0-9]*) start=$1; shift;
case $1 in
[0-9]*) step=$1; shift;;
*) step=100;
esac;;
*) start=100; step=100;;
esac
for file
do
if test -f @$file
then
echo @$file already exists, $file skipped
else
mv $file @$file || exit
echo $file $start
sed 's/pprerr2 *( *\(.*\) *, *\(".*"\));/pprerr2(\1, MESS($, \2));/
s/fixerr2 *( *\(.*\) *, *\(".*"\));/fixerr2(\1, MESS($, \2));/
s/\(err[a-z]*[23]*\) *( *\(".*"\)/\1(MESS($, \2)/
s/MESS([0-9\$]*/MESS($/' @$file |
awk "BEGIN {messnum=$start}"'
/MESS\(/ {n=split($0, field, "$");
if (n==2) {print field[1] messnum field[2]; ++messnum}
else print
}
!/MESS\(/ {print}' >$file
if test -s $file
then
if cmp -s @$file $file
then
mv @$file $file
echo $file unchanged
else
start=`expr $start + $step`
fi
else
mv @$file $file
echo $file clobbered, old version put back
fi
fi
done
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.