|
Last change
on this file was 10, checked in by bird, 23 years ago |
|
Initial revision
|
-
Property cvs2svn:cvs-rev
set to
1.1
-
Property svn:eol-style
set to
native
-
Property svn:executable
set to
*
|
|
File size:
481 bytes
|
| Line | |
|---|
| 1 | # Rename a file only if it is different from a previously existing
|
|---|
| 2 | # file of the same name. This is useful for keeping make from doing
|
|---|
| 3 | # too much work if the contents of a file haven't changed.
|
|---|
| 4 |
|
|---|
| 5 | # This is an MPW translation of the standard GNU sh script move-if-change.
|
|---|
| 6 |
|
|---|
| 7 | Set exit 0
|
|---|
| 8 |
|
|---|
| 9 | If "`exists -f "{2}"`"
|
|---|
| 10 | Compare "{1}" "{2}" >dev:null
|
|---|
| 11 | If {status} != 0
|
|---|
| 12 | Rename -y "{1}" "{2}"
|
|---|
| 13 | Else
|
|---|
| 14 | Echo "{2}" is unchanged
|
|---|
| 15 | Delete -i -y "{1}"
|
|---|
| 16 | End
|
|---|
| 17 | Else
|
|---|
| 18 | Rename -y "{1}" "{2}"
|
|---|
| 19 | End
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.