My build of nnn with minor changes
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.

upload 780 B

12345678910111213141516171819202122232425
  1. #!/usr/bin/env sh
  2. # Description: Paste contents of a text a file http://ix.io
  3. # Upload a binary file to file.io
  4. # Requires: curl, jq, tr
  5. # Note: Binary file set to expire after a week
  6. #
  7. # Shell: POSIX compliant
  8. # Author: Arun Prakash Jana
  9. if ! [ -z "$1" ] && [ -s "$1" ]; then
  10. if [ "$(mimetype --output-format %m "$1" | awk -F '/' '{print $1}')" = "text" ]; then
  11. curl -F "f:1=@$1" ix.io
  12. else
  13. # Upload the file, show the download link and wait till user presses any key
  14. curl -s -F "file=@$1" https://file.io/?expires=1w | jq '.link' | tr -d '"'
  15. # To write download link to "$1".loc and exit
  16. # curl -s -F "file=@$1" https://file.io/?expires=1w -o `basename "$1"`.loc
  17. fi
  18. else
  19. printf "empty file!"
  20. fi
  21. read -r _