[go: up one dir, main page]

File: move-if-change

package info (click to toggle)
dejagnu 1.3-8
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 6,980 kB
  • ctags: 2,855
  • sloc: ansic: 41,277; exp: 9,037; sh: 2,765; makefile: 2,431; lisp: 1,403; tcl: 1,242
file content (15 lines) | stat: -rwxr-xr-x 129 bytes parent folder | download | duplicates (74)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh
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