Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
So you're trying to piece together what exploded between two remote servers. You want to be able to diff files on them, but you don't want to be doing a whole bunch of manual file transfers. Enter:
if [ -z "$1" -o -z "$2" -o -z "$3" ]
echo "Usage: [user@]host1 [user@]host2 path_to_file"
echo ""
echo "Note: If you need to specify a valid key or optional username for the host,"
echo " you are encouraged to add the host configuration to your ~/.ssh/config file."
exit 1
#Inspired by a post on StackOverflow:
colordiff <(ssh "$1" cat "$3") <(ssh "$2" cat "$3")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.