#!/bin/csh
# kopiert Files per scp auf einen anderen Rechner
if ($#argv == 0) then
 echo "USAGE: $0 user host source [target]"
 exit
endif

set noglob
set port = 22
set user = $1
shift
set host = $1
shift
set sources = "$1"
if ($#argv == 2) set target = "$2"
if ($host == "MySun") set port = 222
unset noglob
foreach source ("`echo $sources`")
 if ($?target) then
  scp -B -P ${port} -q "${source}" "${user}@${host}:${target}"
 else
  scp -B -P ${port} -q "${source}" "${user}@${host}:${source}"
 endif
end
