1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
#!/bin/csh -f
set path = (/bin /usr/bin)
foreach i ($*)
set last=$i
end
if (X$last:e == X) then
if (! -d $last) mkdir $last
endif
set updates = 0
echo -n incinstall:
foreach i ($*)
if ($i != $last) then
if (-d $last) then
set file=$last/`basename $i`
else
set file=$last
endif
cmp $i $file >& /dev/null
if ($status != 0) then
if (-f $file) chmod 644 $file
cp $i $file
if ($updates == 0) then
echo -n " updating"
set updates = 1
endif
echo -n " "$i
endif
endif
end
if ($updates == 0) then
echo -n " no updates"
endif
echo ""
|