Created
August 26, 2014 19:45
-
-
Save cowens/abe57d4d7bd7a21434d8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
my $filename = shift; | |
if (my ($target, $path) = $filename =~ /((?:[^@]+@)?[^:]+):(.*)/) { | |
open my $fh, "-|", "ssh", $target, "cat", $path or die "$!"; | |
while (<$fh>) { | |
print; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment