diff options
Diffstat (limited to 'conf.d/99-pastebin.zsh')
-rw-r--r-- | conf.d/99-pastebin.zsh | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/conf.d/99-pastebin.zsh b/conf.d/99-pastebin.zsh index 7e64c8b..42a72cd 100644 --- a/conf.d/99-pastebin.zsh +++ b/conf.d/99-pastebin.zsh @@ -17,7 +17,8 @@ function pbupload() { res=$(curl $PB_CURL_ARGS -sF "c=@$1" "https://$PB_INSTANCE$PB_URL_PATH") fi - local name=$(awk '/url/ { print $2 }' <<<"$res" | tr -d '\n' | sed 's@.*://.*/\(.*\)@\1@') + local full_name=$(awk '/url/ { print $2 }' <<<"$res" | tr -d '\n' | sed 's@.*://.*/\(.*\)@\1@') + local name="${full_name%%.*}" if [ -z "$name" ]; then echo "$res" 1>&2 exit 1 |