#!/bin/csh -f # sp: remote secure put (also see sg) #--------- scp $file to $host = host1 host2 ... other all # usage: sp file [host o all] ################# 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 " --- sp 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 to $host1 ---" scp -p $fn "$user"@"$host1": breaksw case "$h2": echo " --- scp $fn to $host2 ---" scp -p $fn "$user"@$"host2": breaksw case o: echo " --- Enter other full hostname: " set host = $< echo " --- scp $fn to $host ---" scp -p $fn "$user"@"$host": breaksw case all: ##### scp to ALL: echo " ... scp $fn to $host1 ..." scp -p $fn "$user"@"$host1": echo " ... scp $fn to $host2 ..." scp -p $fn "$user"@"$host2": # add others here breaksw endsw