blob: 89aebd00d3a7874b9d9ec2de4a55181e4b70bc7b [file] [log] [blame] [edit]
#!/bin/sh
if [[ $# -lt 2 ]]; then
echo "usage ./mv_pins.sh from.def to.def"
exit
fi
from=$1
to=$2
echo "from: $from"
echo "to: $to"
from_pins=$(sed -n '/PINS/,/END PINS/p' $from)
echo "$from_pins" > $to.pins
sed -e "/PINS/,/END PINS/c\${from_pins}" $to | sed -e "/\${from_pins}/r $to.pins" | sed -e "/\${from_pins}/d" > $to.tmp
mv $to.tmp $to