The little things give you away... A collection of various small helper stuff
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 

4 linhas
539 B

  1. #!/bin/bash
  2. # Reads a list of URLs from stdin, sorts by domain (in reverse label order), protocol, port, auth, and remainder of the URL.
  3. python3 -c 'import re, sys'$'\n''for line in sys.stdin:'$'\n'' line = line.strip()'$'\n'' m = re.search(r"^(?P<protocol>[^/]*)://(?P<auth>[^/@]*@)?(?P<domain>[^/]*?)(?P<port>:\d+)?(?P<rest>(?:/.*)?$)", line)'$'\n'' reversedomain = ".".join(reversed(m["domain"].split(".")))'$'\n'' print(line, reversedomain, m["protocol"], m["port"] or "", m["auth"] or "", m["rest"] or "")' | sort -k2 | cut -d' ' -f1