Skip to content

Instantly share code, notes, and snippets.

@Alloyed
Created October 30, 2013 07:29
Show Gist options
  • Save Alloyed/7228409 to your computer and use it in GitHub Desktop.
Save Alloyed/7228409 to your computer and use it in GitHub Desktop.
# Usage: Either sshcat host:file or sshcat host file
# handy as a drop-in replacement for normal cat in piped oneliners, etc.
sshcat() {
if [[ "$1" == *:* ]]; then
ssh "${1%:*}" "cat ${1##*:}";
else
ssh "$1" "cat $2";
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment