Skip to content

Instantly share code, notes, and snippets.

@horus
Created January 16, 2012 06:19
Show Gist options
  • Select an option

  • Save horus/1619365 to your computer and use it in GitHub Desktop.

Select an option

Save horus/1619365 to your computer and use it in GitHub Desktop.
Simple wrapper for FreeBSD pkg* commands (I HATE typing underscores!)
#!/usr/bin/perl
use strict;
use warnings;
sub AUTOLOAD {
( my $cmd = our $AUTOLOAD ) =~ s/.*:://;
for ( map { ; "$_/pkg_$cmd", "$_/pkg$cmd" } qw(/usr/sbin /usr/local/sbin) )
{
system( $_, @_ ) and last if -x;
}
}
my $cmd = shift;
no strict 'refs';
$cmd->(@ARGV);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment