]>
git.scottworley.com Git - picsort/blob - pic-mv
4 if [[ -e .default
-pic-mv-destdir ]];then
5 destdir
=$( < .default-pic-mv-destdir )
10 while getopts d
:e
:r
: opt
;do
17 shift `expr $OPTIND - 1`
19 if [[ -z "$destdir" ]];then
20 echo "Please specify a destdir with -d or .default-pic-mv-destdir" >&2
27 re_escaped_name
=$(sed 's/[?+*.]/\\&/g' <<< "$name")
30 max
=$(ls "$destdir" | sed -rn "s/^$re_escaped_name ([0-9]+).jpeg$
/\
1/p
" | sort -n | tail -n1)
37 out="$destdir/$name $number.jpeg
"
39 if [[ "$file" == *.NEF ]];then
41 NEFout="$destdir/$name $number.NEF
"
42 if [[ "$rotate" ]];then
43 numeric_exposure=$(dc <<< "2k $exposure 4 / 3.5-p")
44 pics-run-ufraw "$numeric_exposure" "$file" "$out" "$rotate"
46 mv -vi "$exposure/$base.jpeg
" "$out"
48 touch -r "$file" "$out"
49 mv -vi "$file" "$NEFout"
52 if [[ "$rotate" ]];then
53 sed -i "s
/^
# ROBOTS_INSERT_THINGS_HERE\$/\"$name $number.jpeg\" => $rotate,\n&/" "$destdir/rotations.php"