Permalink
Browse files

Improve filename parsing

  • Loading branch information...
vannell committed Oct 10, 2013
1 parent b35b136 commit bd37eb66d71eeb7c54929b17c59efc54d5d3dfb5
Showing with 2 additions and 2 deletions.
  1. +2 −2 wget-gpg
View
@@ -1,8 +1,8 @@
#!/bin/bash
#
wget "$1"
-filename=$(echo "$1" | sed 's/\// /g' | awk '{ print $4 }')
-filenamed=$(echo "$filename" | sed 's/.gpg//')
+filename=${1##*/}
+filenamed=${filename%.*}
gpg "$filename"
if [ -e "$filenamed" ]; then
rm "$filename"

0 comments on commit bd37eb6

Please sign in to comment.