changecnt 315 B

123456789101112131415161718192021
  1. #!/bin/sh
  2. if [ ! $# -eq 4 ]; then
  3. echo 'usage: changecnt op cnt old.cnt new.cnt'
  4. echo 'example: changecnt Iop_DivF64 100 dump.cnt load.cnt'
  5. exit 1
  6. fi
  7. op=$1
  8. vl=$2
  9. dt=$3
  10. lt=$4
  11. sed -e "s/[0-9]* Iop_$op\$/$vl Iop_$op/" <$dt >$lt
  12. if cmp $dt $lt; then
  13. echo "nothing changed"
  14. fi
  15. # --- last line ---