Guest User

Untitled

a guest
Dec 9th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. cse_func()
  2. {
  3. host='username@hostname'
  4. if [ "$1" == 'push' ] ; then
  5. location=$2
  6. files=`echo "$@" | cut -d' ' -f3-`
  7. scp $files $host:"$location"
  8. elif [ "$1" == 'pull' ]; then
  9. if [ $# -gt 3 ]; then
  10. echo "$0: to pull multiple files, write \{remote-file1,remote-file2,...\}"
  11. else
  12. restofcommand=`echo "$@" | cut -d' ' -f2-`
  13. scp $host:$restofcommand
  14. fi
  15. else
  16. if [ $# -gt 0 ]; then
  17. echo "$0: unknown action $1"
  18. else
  19. ssh $host
  20. fi
  21. fi
  22. return 0
  23. }
  24. alias cse=cse_func
Add Comment
Please, Sign In to add comment