John Carter wrote:
I have one ( trying to learn bash scripting )

Is there an easier/better way for a user to obtain ppp0 ip address than

IP=$(netstat -rn | grep UH | cut -d" " -f1 | head -n 1)

perl -le 'print `/sbin/ifconfig eth0`=~/inet addr:(\S+)/'


John Carter                             Phone : (64)(3) 358 6639
Tait Electronics                        Fax   : (64)(3) 359 4632
PO Box 1645 Christchurch                Email : [EMAIL PROTECTED]
New Zealand

John's law :-

All advances in computing have arisen through the creation of an
additional level of indirection, the trick is to work out which
indirection is actually useful.


Thanks John and Adrian

I have tried out your examples and discovered that netstat was
giving the P-t-P address not the inet address.
Perl is on my long list of "Things to look into"
Question how does perl allow me to run ifconfig as a user?

TIA
Col.

Reply via email to