Skip to content

Instantly share code, notes, and snippets.

@a2ikm
Created August 18, 2011 15:21
Show Gist options
  • Select an option

  • Save a2ikm/1154301 to your computer and use it in GitHub Desktop.

Select an option

Save a2ikm/1154301 to your computer and use it in GitHub Desktop.
remote diff for servers on the same directory trees.
#!/usr/bin/env perl
my $name = $ARGV[0];
chomp $name;
my $remote = $ARGV[1];
chomp $remote;
my $path;
if ($name =~ /^//) {
$path = $name;
} else {
my $pwd = `pwd`;
chomp $pwd;
$path = $pwd . "/" . $name;
}
my $cmd = "ssh $remote cat $path | diff -u - $name";
print "$cmd \n";
`$cmd`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment