My build of nnn with minor changes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

upload 536 B

12345678910111213141516171819
  1. #!/usr/bin/env sh
  2. # Description: Upload a file to file.io
  3. # Requires: curl, jq, tr
  4. # Note: File set to expire after a week
  5. #
  6. # Shell: POSIX compliant
  7. # Author: Arun Prakash Jana
  8. if [ -s "$1" ]; then
  9. # Upload the file, show the download link and wait till user presses any key
  10. curl -s -F "file=@$1" https://file.io/?expires=1w | jq '.link' | tr -d '"'
  11. # To write download link to "$1".loc and exit
  12. # curl -s -F "file=@$1" https://file.io/?expires=1w -o `basename "$1"`.loc
  13. else
  14. echo "empty file!"
  15. fi
  16. read -r _