Annotation of 43BSD/contrib/B/src/bint/Change, revision 1.1.1.1

1.1       root        1: : 'Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. '
                      2: : '$Header: Change,v 1.1 85/08/22 16:38:36 timo Exp $'
                      3: 
                      4: : 'Change error messages in limited number of files'
                      5: 
                      6: case $1 in
                      7: [0-9]*) start=$1; shift;
                      8:        case $1 in
                      9:        [0-9]*) step=$1; shift;;
                     10:        *) step=100;
                     11:        esac;;
                     12: *)     start=100; step=100;;
                     13: esac
                     14: 
                     15: for file
                     16: do
                     17:        if test -f @$file
                     18:        then
                     19:                echo @$file already exists, $file skipped
                     20:        else
                     21:                mv $file @$file || exit
                     22:                echo $file $start
                     23:                sed 's/pprerr2 *( *\(.*\) *, *\(".*"\));/pprerr2(\1, MESS($, \2));/
                     24:                         s/fixerr2 *( *\(.*\) *, *\(".*"\));/fixerr2(\1, MESS($, \2));/
                     25:                         s/\(err[a-z]*[23]*\) *( *\(".*"\)/\1(MESS($, \2)/
                     26:                         s/MESS([0-9\$]*/MESS($/' @$file |
                     27:                awk "BEGIN {messnum=$start}"'
                     28:                        /MESS\(/ {n=split($0, field, "$");
                     29:                         if (n==2) {print field[1] messnum field[2]; ++messnum}
                     30:                         else print
                     31:                        }
                     32:                        !/MESS\(/ {print}' >$file
                     33:                if test -s $file
                     34:                then
                     35:                        if cmp -s @$file $file
                     36:                        then
                     37:                                mv @$file $file
                     38:                                echo $file unchanged
                     39:                        else
                     40:                                start=`expr $start + $step`
                     41:                        fi
                     42:                else
                     43:                        mv @$file $file
                     44:                        echo $file clobbered, old version put back
                     45:                fi
                     46:        fi
                     47: done

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.