#!/bin/ksh # connect to example.com, get a file, or put a file. PATH=/usr/local/bin:/bin:/sbin:/usr/bin export PATH tag=${0##*/} cipher="-c arcfour" host=example.com ident="-i $HOME/.ssh/examplecom_dsa" connect () { exec ssh $cipher $ident $host; exit 1; } usage () { echo "usage: $tag [get|put file]"; exit 1; } case "$#" in 0) connect ;; 2) action=$1; file=$2 ;; *) usage ;; esac set -x case "$action" in get) exec scp $cipher $ident $host:$file . ;; put) exec scp $cipher $ident $file $host:/tmp ;; esac exit 1