Как перечислить все комбинации слов?

Используя первый IPv6-адрес из вашего выходного файла, если я просто

$whois 2a02:908::/32 

получаю ожидаемые результаты без ошибки whois (Неизвестный номер AS или неизвестный IP-адрес. Пожалуйста, обновите эту программу (whois).)

$whois 2a02:908::/32
% This is the RIPE Database query service.
% The objects are in RPSL format.
%
% The RIPE Database is subject to Terms and Conditions.
% See http://www.ripe.net/db/support/db-terms-conditions.pdf

% Note: this output has been filtered.
%       To receive output for a database update, use the "-B" flag.

% Information related to '2a02:908::/32'

% Abuse contact for '2a02:908::/32' is 'abuse@umkbw.de'

inet6num:       2a02:908::/32
netname:        DE-KNRW-20090121
country:        DE
org:            ORG-iGCK3-RIPE
admin-c:        UMAC-RIPE
tech-c:         UMTC-RIPE
status:         ALLOCATED-BY-RIR
remarks:        Contact data for any network abuse/spam/security issue:
remarks:        abuse@unitymedia.de
remarks:        =======================================================
remarks:        Contact data for any legal/law enforcement inquiries:
remarks:        Auskunft.UM (at) unitymedia.de
remarks:        Fax: 49 2273 5947 3220 (primary)
remarks:        Fax: 49 2273 5947 2251 (backup)
mnt-by:         RIPE-NCC-HM-MNT
mnt-by:         UNITYMEDIA-MNT
mnt-lower:      UNITYMEDIA-MNT
mnt-routes:     UNITYMEDIA-MNT
mnt-domains:    UNITYMEDIA-MNT
created:        2009-01-21T09:36:59Z
last-modified:  2016-08-25T14:02:54Z
source:         RIPE # Filtered

organisation:   ORG-iGCK3-RIPE
org-name:       Unitymedia NRW GmbH
org-type:       LIR
address:        Aachener Str. 746 - 750
address:        50933
address:        Koeln
address:        GERMANY
phone:          +49 2273 605 8567
fax-no:         +49 2273 5947 2251
fax-no:         +49 2273 605 4339
admin-c:        SB666-RIPE
admin-c:        JK8125-RIPE
admin-c:        MH3982-RIPE
abuse-c:        UKAD1-RIPE
mnt-ref:        RIPE-NCC-HM-MNT
mnt-ref:        UNITYMEDIA-MNT
abuse-mailbox:  abuse@umkbw.de
mnt-by:         RIPE-NCC-HM-MNT
mnt-by:         UNITYMEDIA-MNT
created:        2004-04-17T11:09:24Z
last-modified:  2016-08-25T14:03:26Z
source:         RIPE # Filtered

role:           Unitymedia Administration
address:        Unitymedia Group
                Aachener Strasse 746-750
                50933 Koeln
                Germany
admin-c:        EM572-RIPE
tech-c:         UMTC-RIPE
nic-hdl:        UMAC-RIPE
remarks:        =====================================================
remarks:        Contact data for any legal/law enforcement inquiries:
remarks:        Auskunft.UM (at) unitymedia.de
remarks:        Fax: +49 2273 5947 3220 (primary)
remarks:        Fax: +49 2273 5947 2251 (backup)
remarks:        =====================================================
abuse-mailbox:  abuse@unitymedia.de
mnt-by:         UNITYMEDIA-MNT
created:        2009-07-10T11:13:10Z
last-modified:  2009-09-03T09:14:51Z
source:         RIPE # Filtered

role:           Unitymedia Technical Contact
address:        Unitymedia KabelBW GmbH
address:        Michael-Schumacher-Strasse 1
address:        50170 Kerpen
address:        DE
admin-c:        UMAC-RIPE
tech-c:         MH3982-RIPE
tech-c:         SJ3189-RIPE
tech-c:         EM10466-RIPE
nic-hdl:        UMTC-RIPE
remarks:        =====================================================
remarks:        Contact data for any legal/law enforcement inquiries:
remarks:        Auskunft.UM (at) unitymedia.de
remarks:        Fax: +49 2273 5947 3220 (primary)
remarks:        Fax: +49 2273 5947 2251 (backup)
remarks:        =====================================================
abuse-mailbox:  abuse@unitymedia.de
mnt-by:         UNITYMEDIA-MNT
created:        2009-07-10T11:13:10Z
last-modified:  2014-11-19T06:01:06Z
source:         RIPE # Filtered

% Information related to '2a02:908::/32AS20825'

route6:         2a02:908::/32
descr:          Unitymedia
origin:         AS20825
mnt-by:         UNITYMEDIA-MNT
created:        2009-01-23T22:05:02Z
last-modified:  2009-07-10T15:01:59Z
source:         RIPE

% Information related to '2a02:908::/32AS6830'

route6:         2a02:908::/32
descr:          Unitymedia
origin:         AS6830
mnt-by:         UNITYMEDIA-MNT
created:        2016-02-11T14:56:17Z
last-modified:  2016-02-11T14:56:17Z
source:         RIPE

% This query was served by the RIPE Database Query Service version 1.88 (BLAARKOP)

Это сообщение предлагает вам обновить программу whois.
Пробовали ли вы обновить свою программу whois в последнее время?

1
30.03.2017, 16:59
2 ответа
printf "%s\n" {1,2}" "{a,b,c}
1 a
1 b
1 c
2 a
2 b
2 c

Или

echo {1,2}" "{a,b,c} | xargs -n 2
1 a
1 b
1 c
2 a
2 b
2 c

Как @George Vasiliou упомянул в своем комментарии, когда список может быть записан как диапазон, вы можете использовать его, как показано ниже:

printf '%s\n' {1..2}" "{a..c} 
5
27.01.2020, 23:16
function brace {
  first=$1
  first=${first//,/\\\,}
  first=${first//\{/\{}
  first=${first//\}/\\\}}
  if [[ $first =~ [[:space:]] ]]
  then
    first=${first// /,}
    str={"${first}"}
  else
    str="${first}"
  fi
  shift
  for arg
  do
    arg=${arg//,/\\\,}
    arg=${arg//\{/\\{}
    arg=${arg//\}/\\\}}
    if [[ $arg =~ [[:space:]] ]]
    then
      arg=${arg// /,}
      str="${str}"'" "{'"$arg"'}'
    else
      str="${str}"'" "'"${arg}"
    fi
  done
  eval printf '%s\\n' "$str"
}

$ brace } "a b" { "c,d,e f"
} a { c,d,e
} a { f
} b { c,d,e
} b { f
0
27.01.2020, 23:16

Теги

Похожие вопросы