X-Git-Url: http://git.scottworley.com/picsort/blobdiff_plain/d6874f6c6a9f60aacee8cd43fd16f3e9b73b22ec..a05e21670fd3fd2d8e0de963a21ec871b6725f52:/pic-mv?ds=sidebyside 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