ha-diff
changeset 48 9f66fe44239c
parent 45 377edad75934
child 49 2272c9e2eaf7
equal deleted inserted replaced
45:377edad75934 48:9f66fe44239c
     1 #! /usr/bin/perl
       
     2 # ha-diff [diff-options] <other> file
       
     3 use strict;
       
     4 use warnings;
       
     5 use Cwd qw(abs_path);
       
     6 
       
     7 die "bad usage" if @ARGV < 2;
       
     8 
       
     9 my $file = pop @ARGV;
       
    10 my $other = pop @ARGV;
       
    11 
       
    12 $file = abs_path($file) if not $file =~ /^\//;
       
    13 push @ARGV, "-u" if (not @ARGV);
       
    14 
       
    15 system qq{/bin/bash -c "diff @ARGV --label other <(ssh $other cat '$file') '$file'"};
       
    16 system qq{/bin/bash -c "diff @ARGV --label other --label local <(ssh $other stat '$file') <(stat '$file')"}
       
    17 	if $? == 0;