The little things give you away... A collection of various small helper stuff
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 

26 lignes
846 B

  1. #!/bin/bash
  2. if [[ $# -ne 1 || "$1" == '--help' || "$1" == '-h' ]]; then
  3. printf 'Usage: extract-urls-for-archiveteam-projects PREFIX\n' >&2
  4. printf 'Reads URLs from stdin, extracts interesting for the different currently relevant AT projects into files prefixed by PREFIX\n' >&2
  5. exit 1
  6. fi
  7. prefix="$1"
  8. if [[ "${prefix}" == *[*?[]* ]]; then
  9. printf 'Error: prefixes containing * ? [ not supported\n' >&2
  10. exit 1
  11. fi
  12. if compgen -G "${prefix}*" >/dev/null; then
  13. printf 'Error: there already exist files starting with %q\n' "${prefix}" >&2
  14. exit 1
  15. fi
  16. tee \
  17. >(grep -Fai imgur >"${prefix}-imgur") \
  18. >(grep -Fai -e mediafire -e mfi.re >"${prefix}-mediafire") \
  19. >(grep -Fai pastebin.com >"${prefix}-pastebin") \
  20. >(grep -Fai -e blogspot -e blogger >"${prefix}-blogger") \
  21. >(grep -Fai -e telegram.me -e //t.me/ >"${prefix}-telegram") \
  22. >/dev/null