[LBo] looking for command
TerryJ
listmail at exemail.com.au
Sun Mar 18 08:11:31 CET 2007
Chris F.A. Johnson wrote:
> On Sat, 17 Mar 2007, Chris F.A. Johnson wrote:
>
>> On Sat, 17 Mar 2007, Ray wrote:
>>>
>>
>>> I'm looking for a command that will provide my own IP address
>>> suitable to pass as a commandline paramater to another program.
>>> I am aware of ifconfig and arp and if need be I can parse their
>>> output, (or just do it manually), but if there is an easier way....
>>> What I want is a command that just returns my internal ip address.
>>> i.e. command foo -> 192.168.0.104
>>> is there any such thing?
>
> Missing line:
>
> sep=addr:
>
>> if=eth0 ## adjust to taste
>> temp=$(ifconfig "$if")
>> temp=${temp#*"$sep"}
>> ip=${temp%% *}
How do you get a print of that?
--
Regards, TerryJ
Using Xfce on PCLinuxOS 0.93 and KateOS 3.2. www.revivalcentres.org
More information about the QnA
mailing list