Created
January 16, 2012 06:19
-
-
Save horus/1619365 to your computer and use it in GitHub Desktop.
Simple wrapper for FreeBSD pkg* commands (I HATE typing underscores!)
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; | |
| 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