diff options
author | Till Höppner | 2017-05-20 04:11:48 +0200 |
---|---|---|
committer | Till Höppner | 2017-05-20 04:11:48 +0200 |
commit | da57b6764606cea347c135771f46c6cd88b63a45 (patch) | |
tree | 853ff2d925ad530539db47ff4ca67cd695c4ec63 /conf.d/99-pastebin.zsh | |
parent | 1b81a1e369c62f7e50c6fa002a68c7a562a0968a (diff) | |
download | zsh-da57b6764606cea347c135771f46c6cd88b63a45.tar.gz zsh-da57b6764606cea347c135771f46c6cd88b63a45.tar.xz zsh-da57b6764606cea347c135771f46c6cd88b63a45.zip |
Strip names of file extension
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 |