Last active
December 29, 2017 04:00
-
-
Save GitaiQAQ/99d84a821166076a3370b7b9f33284ce to your computer and use it in GitHub Desktop.
上传图片到 SM.MS 的脚本
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
| #!bin/bash | |
| # 上传图片到 SM.MS 的脚本 | |
| # ./sm.sh image1.png image2.png | |
| jsonRet="" | |
| for f in "$@" | |
| do | |
| ref=$(curl --progress-bar -F smfile=@$f https://sm.ms/api/upload | jq '"[\(.data.filename)](\(.data.url))"') | |
| ref=${ref//\"/} | |
| jsonRet=${jsonRet}$ref"\n" | |
| done | |
| echo -e $jsonRet | xsel -b |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment