Re: ifconfig data



Tzafrir Cohen <tzafrir@xxxxxxxxxxxxx> writes:

On Thu, Feb 19, 2009 at 02:02:36PM +0100, Tanco . wrote:
Hi Hugo,

this will give you the IP :)

ifconfig ppp0 | grep "inet addr:" | awk '{ print $2}' | tail -c14

ifconfig ppp0 | awk '/inet addr:/{ print $2}' | cut -d: -f2

ifconfig ppp0 | awk '/inet addr:/{ split($2, a, ":"); print a[2] }'

Once you invoke awk, you may as well use it for all your string
manipulation.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx
with a subject of "unsubscribe". Trouble? Contact listmaster@xxxxxxxxxxxxxxxx



Relevant Pages

  • Re: C++ programming: keeping count of data items read from file
    ... Debug the data generator /in situ/ with a good debugger, and bypass the need to do the sanity checking. ... Read one line at a time in as a string, ... that fscanf method looks interesting. ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx with a subject of "unsubscribe". ...
    (Debian-User)
  • Re: [OT] C++ programming: keeping count of data items read from file
    ... HTH ... Kind of defeats the purpose of having string in the first place.) ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx with a subject of "unsubscribe". ...
    (Debian-User)
  • Re: OT: matched string of a regular expression
    ... However my sed script currently involves 6 lines (for all the ... how can I obtain the string that is matched by a regular ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ... Trouble? ...
    (Debian-User)
  • Re: Losing _b00jdlb8_default from a files name?
    ... Ooh, yea, that looks like it would do it, way better than what I came up ... vague on my sed syntax, ... Using the $ to anchor to the end of the string is the key here. ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)
  • Re[2]: ppp -auto my_provider
    ... full log (if it help you remeber that string, ... typing killall sendmail ... To unsubscribe, ...
    (freebsd-questions)