home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1999 mARCH / PCWK3A99.iso / Linux / DDD331 / DDD-3_1_.000 / DDD-3_1_ / ddd-3.1.1 / move-if-change < prev    next >
Text File  |  1995-05-01  |  129b  |  16 lines

  1. #!/bin/sh
  2. if
  3. test -r $2
  4. then
  5. if
  6. cmp $1 $2 > /dev/null
  7. then
  8. echo $2 is unchanged
  9. rm -f $1
  10. else
  11. mv -f $1 $2
  12. fi
  13. else
  14. mv -f $1 $2
  15. fi
  16.