Advertisement
Tyler_Elric

sendfile.bash

Apr 9th, 2016
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.27 KB | None | 0 0
  1. #!/usr/bin/env bash
  2. echo SENDFILE $@
  3. fn=$(basename "$2")
  4. relpath=`python -c "import os,sys;print(os.path.dirname(os.path.relpath(sys.argv[1],os.getcwd())))" $2`
  5. echo sending $fn
  6. ssh <$2 $1 "mkdir -p "$relpath"; cat >\"$relpath/$fn\""
  7. echo Transmission of $fn complete.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement