X-Git-Url: http://git.scottworley.com/picsort/blobdiff_plain/d6874f6c6a9f60aacee8cd43fd16f3e9b73b22ec..70f277664128fdf614dd61f3b8737829ba28638e:/pic-mv?ds=inline diff --git a/pic-mv b/pic-mv index 23da8c3..0309ec0 100755 --- a/pic-mv +++ b/pic-mv @@ -24,8 +24,10 @@ fi file="$1" name="$2" +re_escaped_name=$(sed 's/[?+*.]/\\&/g' <<< "$name") + # Find next number -max=$(ls "$destdir" | sed -rn "s/^$name ([0-9]+).jpeg$/\1/p" | sort -n | tail -n1) +max=$(ls "$destdir" | sed -rn "s/^$re_escaped_name ([0-9]+).jpeg$/\1/p" | sort -n | tail -n1) if [[ "$max" ]];then number=$((max + 1)) else