A simple which clone:
#!/usr/bin/env perl
$target = $ARGV[0];
$path = $ENV{PATH};
@path = split ":", $path;
for(@path) {
$b = "$_/$target";
if( -x "$b" ) {
print "$b\n";
exit 0;
}
}
exit 1;A simple which clone:
#!/usr/bin/env perl
$target = $ARGV[0];
$path = $ENV{PATH};
@path = split ":", $path;
for(@path) {
$b = "$_/$target";
if( -x "$b" ) {
print "$b\n";
exit 0;
}
}
exit 1;