=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
                             UNIX GURU UNIVERSE
                                UNIX HOT TIP

                       Unix Tip 2371 - June 29, 2006

                   
http://www.ugu.com/sui/ugu/show?tip.today
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

IP 주소를 알아내는 또 다른 방법
 
이전의 팁은 ifconfig의 출력을 이용하여 시스템의 IP 주소를 알아 내는 방법을
나타냈다. 하지만 ifconfig의 출력이 시스템마다 다르다.

Solaris에서는

ifconfig -a | grep "inet" |  grep -v "127.0.0.1" | awk '{print $2;}'

HP-UX에서는

ifconfig foo | grep "inet" | awk '{print $2;}'

여기서 foo는 인터페이스, 일반적으로 lan0, lan1등을 나타낸다.
 
@@@@@@@@@@@@@@@@@@@@[ 원문 ]@@@@@@@@@@@@@@@@@@@@

ANOTHER GET YOUR IP ADDRESS

A previous tip listed how
to get the IP address for your
system using the output from
ifconfig. However the output
from ifconfig is different
across systems.

For Solaris use:

ifconfig -a | grep "inet" |  grep -v "127.0.0.1" | awk '{print $2;}'

For HP-UX use:

ifconfig foo | grep "inet" | awk '{print $2;}'

Where foo is the interface, generally lan0, lan1 etc.
반응형
Posted by She쥐포s

블로그 이미지
She쥐포s
Yesterday
Today
Total

달력

 « |  » 2024.5
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

최근에 올라온 글

최근에 달린 댓글

글 보관함