view move-if-change @ 12632:2dbac27e0e40 stable

doc: miscellaneous touch-ups to documentation strings * debug.txi: Correct line number for debug example. * func.txi: Correct directory structure of functions shipped with Octave distribution. * edit.m: Eliminate reference to editor used by bug_report. * fzero.m: Add inline function to list of possible inputs. * fplot.m: Add comma to break list of possible inputs. * qqplot.m: Correct example so that it runs under current Octave distributions. * assert.m: Add seealso reference to fail. * fail.m: Add seealso reference to assert. Add additional calling forms of function. * load-path.cc (addpath): Don't use @samp which created double double quotes around option. * ov-fcn-inline.cc (vectorize): Add example usage. * variables.cc (exist): Add seealso link to file_in_loadpath.
author Rik <octave@nomad.inbox5.com>
date Mon, 25 Apr 2011 09:24:33 -0700
parents 12ff450cbb1f
children
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