#!/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 ""

