When you write scripts dealing with setting up or analyzing network interfaces you will eventually run into the task of converting a netmask from one format into another.
Typically, the setup of an ethernet TCP/IP network interface consists of an IP address, a netmask, and a broadcast address. Unfortunately for you as a novice, the two tools
ifconfig and
ip show the same (or similar) information in a different format.
Quote:
$ /sbin/ifconfig
eth0 Link
...