Last active
January 4, 2020 05:39
-
-
Save pleasemarkdarkly/358028bc369f02dd68eca780680e0f41 to your computer and use it in GitHub Desktop.
Command line moving around of files
This file contains 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
# https://transfersh.pleasemarkdarkly.com/XSkei/transfer.sh | |
# http://bit.ly/2QJUGkL | |
# This gist | |
# http://bit.ly/2FpgtZz | |
transfer(){ if [ $# -eq 0 ];then echo "No arguments specified.\nUsage:\n transfer <file|directory>\n ... | transfer <file_name>">&2;return 1;fi;if tty -s;then file="$1";file_name=$(basename "$file");if [ ! -e "$file" ];then echo "$file: No such file or directory">&2;return 1;fi;if [ -d "$file" ];then file_name="$file_name.zip" ,;(cd "$file"&&zip -r -q - .)|curl --progress-bar --upload-file "-" "https://transfersh.pleasemarkdarkly.com/$file_name"|tee /dev/null,;else cat "$file"|curl --progress-bar --upload-file "-" "https://transfersh.pleasemarkdarkly.com/$file_name"|tee /dev/null;fi;else file_name=$1;curl --progress-bar --upload-file "-" "https://transfersh.pleasemarkdarkly.com/$file_name"|tee /dev/null;fi;} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment