The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




Thread: Some Info.
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 03-29-2008
era era is offline Forum Advisor  
Herder of Useless Cats (On Sabbatical)
  
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,652
You should find the manual pages for your system. If you are not at the computer, you can easily find them in Google.

This invocation of cut extracts the second field in a colon-delimited line (or sequence of lines, more generally). Similarly, the awk program prints the first field on a space-separated line (or sequence of lines, more generally).

Bottom line, it extracts the IP address of the interface out of the ifconfig output.

The whole process could have been done more elegantly using just ifconfig and awk, possibly at a modest decrease in maintainability, or ifconfig, grep, and two invocations of cut.