[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Get the ip address without using "root"?



/sbin/ifconfig eth0 | awk '/^ +inet addr:/ { split($2, a, ":"); print a[2] }

or

/sbin/ifconfig eth0 | sed -ne 's,^.*inet addr:\([0-9.]*\).*,\1,p'



Reply to: