Using the command line tools available in a common GNU/Linux distro (e.g. Fedora/Debian/Ubuntu/etc), is there a general way to get the value of some specific WHOIS field (e.g. the registrant's organisation name), ideally without having to build a custom WHOIS parser that is hard-coded to handle the differences between each registry's output?
This seems worth asking, because the output from the whois command does not appear to be very consistent. For example, compare:
$ whois trigger.io [...] Owner OrgName : Amir Nathoo [...] with:
$ whois facebook.com [...] Registrant Organization: Facebook, Inc. [...] I would like, instead, to be able to pass, as arguments to some command:
- the domain name
- the desired field
and have the output simply be the value of the desired field. For instance, based on the examples above, something like:
$ some_whois_command -field organization_name trigger.io Amir Nathoo $ some_whois_command -field organization_name facebook.com Facebook, Inc. Is this possible?
Ideally, I would like the solution to centre on the whois command, e.g. with some suitable usage of -i, -q, -t, and/or -v, as I want to learn how to make effective use of these options. I will accept another solution as correct if necessary, however.