Skip to content

Instantly share code, notes, and snippets.

@joet3ch
Created September 17, 2010 03:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joet3ch/583598 to your computer and use it in GitHub Desktop.
Save joet3ch/583598 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
my $ifconfig = exec('ifconfig eth0 | grep inet | awk \'{print $2}\'');
$ifconfig =~ /\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/;
print $ifconfig;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment