view build-aux/move-if-change @ 19803:70911df8ad28

gray2ind: return uint8 when (n <= 256) instead of (n < 256) (bug #44309) * gray2ind.m: the class of the indexed image returned by gray2ind is dependent on the number of indices to use. If there are 256 or less, we return uint8, and uint16 otherwise. Add more tests for the limits.
author Carnë Draug <carandraug@octave.org>
date Thu, 19 Feb 2015 14:29:34 +0000
parents b67c2d580a25
children 5e50f25f245a
line wrap: on
line source

#!/bin/sh
#
# Like mv $1 $2, but if the files are the same, just delete $1.
# Status is 0 if $2 is changed, 1 otherwise.

if test -r $2; then
  if cmp $1 $2 > /dev/null; then
    echo $2 is unchanged
    rm -f $1
  else
    mv -f $1 $2
  fi
else
  mv -f $1 $2
fi