#!/bin/csh -f # remote get (also see sp) #--------- scp $file from $host = host1 host2 ... other # usage: sg file [host o] ################# YOU MUST CHANGE THESE : set user = "USER" ## <- replace USER with your user name set host1 = "HOST1" ## <- replace HOST1 with a machine address set h1 = "H1" ## <- replace H1 with a short name for host1 set host2 = "HOST2" ## <- replace HOST2 with a machine address set h2 = "H2" ## <- replace H2 with a short name for host2 #.. enter more such pairs if you like... ### ### NOTE: you may need to replace "scp" by "scp2" for some hosts ! ### ###----------------- echo " " set fn = $1 set host = $2 if( "$1" == "" ) then echo -n " --- sg file [host] --- Enter file name: " set fn = $< endif if( "$2" == "" ) then echo " --- choose HOST -> $h1 $h2 ... o(ther) all ---" echo -n " --- Enter host: " set host = $< endif switch ( "$host" ) case "$h1": echo " --- scp $fn from $host1 ---" scp -p "$user"@"$host1":"$fn" . breaksw case "$h2": echo " --- scp $fn from $host2 ---" scp -p "$user"@$"host2":"$fn" . breaksw case o: echo " --- Enter other full hostname: " set host = $< echo " --- scp $fn from $host ---" scp -p "$user"@"$host":"$fn" . breaksw endsw