#!/bin/ksh ### ### verschijf board_xy coordinaten met een xy-offset ### ### File : shift_xy ### Author : B.Willemsen ### Revision : A.0 ### Date : 15-12-1995 ### Manual : /usr/local/man/cat1/shift_xy ### file=$1 x=$2 y=$3 awk -v X=$x -v Y=$y ' { if (index($0, "TOOLING")) { print $0 getline while ( length ($0) != 0 ) { newX = $2 + X newY = $3 + Y printf(" %s %s, %s;\n", $1, newX, newY) getline } } if (index($0, "NODE")) { print $0 getline print $0 # ALTERNATES getline while ( length ($0) != 0 ) { newX = $1 + X newY = $2 + Y printf(" %s, %s %s;\n", newX, newY, $3) getline } } if (index($0, "OTHER")) { print $0 getline # ALTERNATES print $0 getline # coordinates ect. while ( length ($0) != 0 ) { newX = $1 + X newY = $2 + Y printf(" %s, %s %s %s %s %s\n", newX, newY, $3, $4, $5, $6) getline } } if (index($0, "EXTRAS")) { print $0 getline # coordinates ect. while ( length ($0) != 0 ) { newX = $1 + X newY = $2 + Y printf(" %s, %s %s %s %s %s;\n", newX, newY, $3, $4, $5, $6) getline } } print $0 } ' $file