getif | |||
| For a linux init-script I needed to get the IP-address of an interface. Obviously ifconfig does the job, but the resulting output is very long, and you need to write nontrivial sed-scripts to extract the simple IP-address.
The IP-address is also nowhere in the /proc-filesystem, so I have written getif, which just extracts the necessary information and nothing else. getif supports the following arguments:
To compile getif just type make getif and copy the executable to your favority directory. There are no special permissions necessary. | |||
|