Easy file sharing from the command line (*)

Put this code into your own transfer.sh script.

#!/bin/sh
SITE=transfer.rrq.au

for F in $* ; do
    if [ -r "$F" ] ; then
	# Upload $F under its basename
	curl --upload-file "$F" "https://$SITE/$(basename "$F")"
	echo
    elif [ -z "${F##http*}" ] ; then
	# Download the $F URL into its basename
	curl -s "$F" > "$(basename "$F")"
	echo "$(basename "$F")"
    else
	echo "Not sure what to do with $F" >&2
    fi
done

(*) using transfersh-v1.6.1-linux-amd64 by DutchCoders.

Or transfer it here:
© 2024 Ralph Ronnquist