Image 01
profile-image

ChriZus

Chris B
"Stylus Sysinfo" superkaramba theme

Karamba & Superkaramba by stylus 7 comments

i changed the command a bit. It's now also compatible with longer ip addresses.

You don't need to adjust the range anymore

ifconfig eth0 | grep 'inet addr:' | { read -a words; echo ${words[1]}; } | cut -b 6-

enjoy!! - Apr 07 2005
"Stylus Sysinfo" superkaramba theme

Karamba & Superkaramba by stylus 7 comments

Since I don't have the IP command installed on my distro, I had to find a way around this. I found the following command to work for me.

program="ifconfig eth0 | grep 'inet addr:' | cut -b 21-31"

You might want to adjust the cut range
21 is the byte where the ip starts, but the length should be adjusted to the expected length of the ip address.

replace eth0 with the interface you want the ip for. - Apr 06 2005