On Friday 18 August 2006 03:09, Deephay wrote:
> Greetings all,
>
> How to get the address of the local machine without using "root"?
> ifconfig cannot be issued by a common user. TIA!
Yes, it can. Type the full path: /sbin/ifconfig
--
Paul Johnson
Email and IM (XMPP & Google Talk): [EMAIL PRO
thank you all!
Deephay
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
/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'
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Steve Kemp <[EMAIL PROTECTED]> writes:
> /sbin/ifconfig eth0 | grep "inet addr" | awk '{print $2}'| awk -F: '{print
> $2}'
awk can select the line and do the double split in one go:
/sbin/ifconfig eth0 | awk '($0 ~ /^ +inet addr:/) { split($2, a, ":"); print
a[2] }'
--
,''`.
: :' :
On Fri, Aug 18, 2006 at 06:09:59PM +0800, Deephay wrote:
> How to get the address of the local machine without using "root"?
> ifconfig cannot be issued by a common user. TIA!
Yes it can, the only problem is that by default /sbin will not be
on the PATH of a non-root user.
Just run it as fo
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Fri, Aug 18, 2006 at 06:09:59PM +0800, Deephay wrote:
> Greetings all,
>
> How to get the address of the local machine without using "root"?
> ifconfig cannot be issued by a common user. TIA!
Why?
it works fine here (though you have to enter the fu
> How to get the address of the local machine without using "root"?
> ifconfig cannot be issued by a common user. TIA!
It can, '/sbin/ifconfig'.
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Greetings all,
How to get the address of the local machine without using "root"?
ifconfig cannot be issued by a common user. TIA!
Deephay
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
8 matches
Mail list logo