I'm currently working with this

> 
> 
> ```
>      IFTUN="$(ifconfig tun)"
>      IPADD=${IFTUN:106:13}
>      echo $IPADD
> 
> ```
> 
> 

But if the size of the IP address changes this isn't going to work anymore.

> 
> 
> ```
>      inet addr:1.2.3.4  P-t-P:1.2.3.4  Mask:255.255.254.0
>      UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
>      RX packets:1151 errors:0 dropped:0 overruns:0 frame:0
> 
> ```
> 
> 

So what I'm after is a way to get the IP from ifconfig no matter what the number of chars is "1.2.3.4" or say "111.22.3.44" or even "111.222.333.444"