<p>$ ip ls</p>
<p>You can grep for the if you&#39;re interested in. ip, from the iproute2 package, is the preferred mechanism for working with the networking stack in Linux; it is far more capable than ifconfig is.</p>
<p>--<br>
Sent from my phone... a G2 running CM7 nightlies!</p>
<div class="gmail_quote">On Jun 4, 2011 1:51 AM, &quot;James Sumners&quot; &lt;<a href="mailto:james.sumners@gmail.com">james.sumners@gmail.com</a>&gt; wrote:<br type="attribution">&gt; I need to get the IP address of the local machine on which a script is<br>
&gt; being executed. The script is going to be run by an unprivileged user<br>&gt; (so /sbin is not in the PATH). Does anyone know of a better way than<br>&gt; this:<br>&gt; <br>&gt; IP=$(host $(hostname) | awk &#39;{print $4}&#39;)<br>
&gt; <br>&gt; -- <br>&gt; James Sumners<br>&gt; <a href="http://james.roomfullofmirrors.com/">http://james.roomfullofmirrors.com/</a><br>&gt; <br>&gt; &quot;All governments suffer a recurring problem: Power attracts<br>&gt; pathological personalities. It is not that power corrupts but that it<br>
&gt; is magnetic to the corruptible. Such people have a tendency to become<br>&gt; drunk on violence, a condition to which they are quickly addicted.&quot;<br>&gt; <br>&gt; Missionaria Protectiva, Text QIV (decto)<br>&gt; CH:D 59<br>
&gt; _______________________________________________<br>&gt; Ale mailing list<br>&gt; <a href="mailto:Ale@ale.org">Ale@ale.org</a><br>&gt; <a href="http://mail.ale.org/mailman/listinfo/ale">http://mail.ale.org/mailman/listinfo/ale</a><br>
&gt; See JOBS, ANNOUNCE and SCHOOLS lists at<br>&gt; <a href="http://mail.ale.org/mailman/listinfo">http://mail.ale.org/mailman/listinfo</a><br></div>