outgoing mail

Giorgos Keramidas keramida at ceid.upatras.gr
Sun Mar 16 02:41:02 EET 2003


On 2003-03-16 00:18, Kostas Peletidis <kpeletidis at yahoo.com> wrote:
>Giorgos Keramidas wrote:
>> $ ifconfig tun0 | grep inet | awk '{print $2}'
>> 212.205.215.169
>
> Den kserw gia tous ypoloipous pou diavazoun th lista, pantws sto
> diko mou mhxanhma(Linux 2.4.20) oi parapanw entoles epistrefoun thn
> ip me to pro8ema "addr:". Gia paradeigma:
>
> $ /sbin/ifconfig ppp0 | grep inet | awk '{print $2}'
> addr:81.76.177.203

Dikio exeis...  Eimai gnostos 'egka8etos FreeBSD user' sth lista kai
oi diafores sto output twn entolwn einai sinithismeno pragma, afou to
BSD exei mikrodiafores ston tropo pou douleuei.

> Proswpika, xrhsimopoiw thn colrm gia na parw thn ip apo to parapanw
> output. Dhladh:
>
> $ /sbin/ifconfig ppp0 | grep inet | awk '{print $2}' | colrm 1 5
> 81.76.177.203

	- substr() mesa sto awk script.
	- pipe tou output sto cut -d: -f2
	- sed -e 's/^.*://'

Yparxoun diaforoi tropoi.  To shmantiko einai oti kaaaaapos etsi
pairnoume to IP tou network interface.

> Elpizw to parapanw na fanei xrhsimo :-)

Nai, bebaia.  Fxaristw pou to dokimases kai esteiles apanthsh :)

- Giorgos




More information about the Linux-greek-users mailing list