Skip to content

Instantly share code, notes, and snippets.

@andrewpage
Created June 18, 2015 00:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewpage/5bc187e7819a9c725826 to your computer and use it in GitHub Desktop.
Save andrewpage/5bc187e7819a9c725826 to your computer and use it in GitHub Desktop.
function to scp through a jumphost
function scpt {
origin=$1
origin_filename=$(basename $origin)
jumphost=$2
destination=$3
echo "SCPing '$origin' through jumphost '$jumphost' to destination '$destination'."
cat < $origin | ssh $jumphost "cat > $origin_filename && scp $origin_filename $destination && rm $origin_filename"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment