diff options
author | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 1997-08-11 15:56:58 +0000 |
---|---|---|
committer | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 1997-08-11 15:56:58 +0000 |
commit | 071cd279a6ac9efccecd8171777a9fc99ac4796a (patch) | |
tree | b2e1ea43e0bdba8cca9bb02ed01f5e3da5a955a6 /gcc/move-if-change | |
parent | 5b48acd0eb694e43d357e6ad8f2daa604ad8d2ff (diff) | |
download | gcc-071cd279a6ac9efccecd8171777a9fc99ac4796a.tar.gz |
Initial revision
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@14764 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/move-if-change')
-rwxr-xr-x | gcc/move-if-change | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/move-if-change b/gcc/move-if-change new file mode 100755 index 00000000000..66d8b8adc7f --- /dev/null +++ b/gcc/move-if-change @@ -0,0 +1,17 @@ +#!/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 -s $1 $2 +then +echo $2 is unchanged +rm -f $1 +else +mv -f $1 $2 +fi +else +mv -f $1 $2 +fi |