Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #205452

Re: get my ip address

From John Crawley <john@bunsenlabs.org>
Newsgroups linux.debian.user
Subject Re: get my ip address
Date 2019-02-17 05:00 +0100
Message-ID <xslMt-FH-1@gated-at.bofh.it> (permalink)
References (2 earlier) <xrO4a-5lu-5@gated-at.bofh.it> <xrVyG-1xe-5@gated-at.bofh.it> <xrVyG-1xe-3@gated-at.bofh.it> <xrXK9-2Zj-3@gated-at.bofh.it> <xs0I1-4Qs-1@gated-at.bofh.it>
Organization BunsenLabs

Show all headers | View raw


On 16/02/2019 14.28, David Wright wrote:
> On Sat 16 Feb 2019 at 11:10:32 (+0900), John Crawley wrote:
>> On 16/02/2019 08.54, David Wright wrote:
>>> On Fri 15 Feb 2019 at 22:04:42 (+0000), Darac Marjal wrote:
>>>> If you're going to recommend parsing `ip`, the -j option may be more
>>>> amenable to scripting. (JSON output)
---
>>> (Sorry if I was expected to explicitly write "shell scripting".)
>>> … I don't think that JSON would be any help: rather, the opposite.
>>
>> Though a call to jq makes parsing json very easy for shell scripts.
> 
> I'm not sure I understand why you'd ask ip to write JSON, and then
> post-process it with jq to filter it to different JSON, and then
> parse it in a shell, rather than just parsing something as simple as
> the oneline format using the tools that every system has installed

jq can pull out the exact element of the json that you want, making 
further shell parsing unnecessary.
Totally unrelated example, (Adobe flash player downloads)
this query:
curl -s 
"https://get.adobe.com/flashplayer/webservices/json/?platform_type=Linux&platform_arch=x86-32&browser_dist=Chrome" 
| jq -r '.[0].download_url'
returns:
http://fpdownload.adobe.com/pub/flashplayer/pdc/32.0.0.142/flash_player_ppapi_linux.i386.tar.gz

-- 
John

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

get my ip address tony <lists@vanderhoff.org> - 2019-02-15 11:40 +0100
  Re: get my ip address <tomas@tuxteam.de> - 2019-02-15 11:50 +0100
  Re: get my ip address Markus Schönhaber <debian-user@list-post.mks-mail.de> - 2019-02-15 12:10 +0100
    Re: get my ip address David Wright <deblis@lionunicorn.co.uk> - 2019-02-15 17:00 +0100
      Re: get my ip address David Wright <deblis@lionunicorn.co.uk> - 2019-02-16 01:00 +0100
        Re: get my ip address John Crawley <john@bunsenlabs.org> - 2019-02-16 03:20 +0100
          Re: get my ip address David Wright <deblis@lionunicorn.co.uk> - 2019-02-16 06:30 +0100
            Re: get my ip address John Crawley <john@bunsenlabs.org> - 2019-02-17 05:00 +0100
              Re: get my ip address David Wright <deblis@lionunicorn.co.uk> - 2019-02-20 05:40 +0100
      Re: get my ip address tony <lists@vanderhoff.org> - 2019-02-16 11:20 +0100
        Re: get my ip address David Wright <deblis@lionunicorn.co.uk> - 2019-02-20 05:40 +0100
  Re: get my ip address Greg Wooledge <wooledg@eeg.ccf.org> - 2019-02-19 16:20 +0100
    Re: get my ip address tony <lists@vanderhoff.org> - 2019-02-19 16:50 +0100
      Re: get my ip address Dan Ritter <dsr@randomstring.org> - 2019-02-19 17:40 +0100
        Re: get my ip address tony <lists@vanderhoff.org> - 2019-02-19 18:10 +0100
        Re: get my ip address Greg Wooledge <wooledg@eeg.ccf.org> - 2019-02-19 18:10 +0100
        Re: get my ip address tony <lists@vanderhoff.org> - 2019-02-20 11:40 +0100
          Re: get my ip address Dan Ritter <dsr@randomstring.org> - 2019-02-20 13:30 +0100
            Re: get my ip address tony <lists@vanderhoff.org> - 2019-02-20 14:00 +0100
  Re: get my ip address Jonathan de Boyne Pollard <J.deBoynePollard-newsgroups@NTLWorld.COM> - 2019-02-28 15:40 +0100

csiph-web