Last active
April 1, 2025 15:59
-
-
Save jamesduncombe/bbf87122ee31067a8ccb8783f3c871f8 to your computer and use it in GitHub Desktop.
Amnesia.io bash alias
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
amn() { | |
if [ $# -ge 1 -a ! -f $1 ]; then | |
input=$(cat -) | |
temp=$(mktemp) | |
echo $input > $temp | |
curl -sF "file=@$temp;filename=xyz.$1" https://amnesia.im | |
rm $temp | |
elif [ $# -ge 1 -a -f $1 ]; then | |
curl -sF "file=@$1" https://amnesia.im | |
else | |
echo "No filename provided (amn [filename])" | |
echo "Try:" | |
echo "amn [filename]" | |
echo "or" | |
echo "pbpaste | amn [filetype]" | |
echo "More info: https://amnesia.im" | |
return 1 | |
fi | |
} |
Author
jamesduncombe
commented
Apr 1, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment