Skip to content

Instantly share code, notes, and snippets.

@rightgo09
Created April 27, 2012 01:49
Show Gist options
  • Save rightgo09/2504997 to your computer and use it in GitHub Desktop.
Save rightgo09/2504997 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl
use File::Spec;
my $pg = shift(@ARGV);
for my $path (split /:/, $ENV{PATH}) {
if (-x File::Spec->catfile($path, $pg)) {
print File::Spec->catfile($path, $pg), "\n";
last;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment