Networking script I am working on. This prints some information about your machine.

Posted: September 23, 2012. At: 10:52 PM. This was 5 years ago. Post ID: 4613
Page permalink.
WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters. These cookies expire two weeks after they are set.

This Perl script will print some information about your networking set-up on your Linux machine.

use warnings;
$iface = "eth0";
@data = `ifconfig`;
$net = $data[1];
$kernel = `uname -r`;
printf("The IP of %s is:%s\n", $iface, $net);
printf("The kernel version is: %s\n", $kernel);

This is the output this script will give you.

jason@jason-desktop:~/Documents$ ./ 
The IP of eth0 is:        inet  netmask  broadcast
The kernel version is: 4.10.0-32-generic

No comments have been made. Use this form to start the conversation :)

Leave a Reply