[plug] shell script

Ryan ryan at prodigital.net.au
Wed Jan 9 23:48:58 WST 2002


that would work in a script, but on the command line you'd want to try this:

export WAN_IFACE="ppp0"
export WAN_IP="`/sbin/ifconfig ${WAN_IFACE} |grep inet |cut -d : -f 2 |cut 
-d \  -f 1`"
echo ${WAN_IP}

Ryan


>but what is wrong with it? I have tried all sorts of quotes `,",' as
>well as no quote but nothing works
>
>
>
>[root at lycra]# WAN_IFACE="ppp0"
>[root at lycra]# echo $WAN_IFACE
>ppp0
>[root at lycra]# WAN_IP= `/sbin/ifconfig $WAN_IFACE |grep inet |cut -d : -f 2 
>|cut -d \  -f 1`
>bash: 130.116.4.29: command not found
>[root at lycra]# echo $WAN_IP



More information about the plug mailing list