/[autoconf]/autoconf/config/move-if-change
ViewVC logotype

Diff of /autoconf/config/move-if-change

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by akim, Sat Jun 9 18:16:43 2001 UTC revision 1.2 by akim, Fri Nov 15 09:17:30 2002 UTC
# Line 1  Line 1 
1  #!/bin/sh  #!/bin/sh
2  # Like mv $1 $2, but if the files are the same, just delete $1.  # Like mv $1 $2, but if the files are the same, just delete $1.
3  # Status is 0 if $2 is changed, 1 otherwise.  # Status is 0 if $2 is changed, 1 otherwise.
4  if  if test -r $2; then
5  test -r $2    if cmp -s $1 $2; then
6  then      echo $2 is unchanged
7  if      rm -f $1
8  cmp -s $1 $2    else
9  then      mv -f $1 $2
10  echo $2 is unchanged    fi
 rm -f $1  
11  else  else
12  mv -f $1 $2    mv -f $1 $2
 fi  
 else  
 mv -f $1 $2  
13  fi  fi

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26