Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cse_func()
- {
- host='username@hostname'
- if [ "$1" == 'push' ] ; then
- location=$2
- files=`echo "$@" | cut -d' ' -f3-`
- scp $files $host:"$location"
- elif [ "$1" == 'pull' ]; then
- if [ $# -gt 3 ]; then
- echo "$0: to pull multiple files, write \{remote-file1,remote-file2,...\}"
- else
- restofcommand=`echo "$@" | cut -d' ' -f2-`
- scp $host:$restofcommand
- fi
- else
- if [ $# -gt 0 ]; then
- echo "$0: unknown action $1"
- else
- ssh $host
- fi
- fi
- return 0
- }
- alias cse=cse_func
Add Comment
Please, Sign In to add comment