Skip to content

Instantly share code, notes, and snippets.

@cowens
Created August 26, 2014 19:45
Show Gist options
  • Save cowens/abe57d4d7bd7a21434d8 to your computer and use it in GitHub Desktop.
Save cowens/abe57d4d7bd7a21434d8 to your computer and use it in GitHub Desktop.
#!/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