nicer formatting
[tridge/junkcode.git] / sortit.sh
1 #!/bin/bash
2
3 mkdir -p photos/other
4
5 for f in $*; do
6     d=`jhead $f| grep ^Date/Time | cut -c16-26| sed 's|:|/|g'`
7     if [ -z "$d" ]; then
8         fname=`basename $f`
9         echo photos/other/$fname
10         ln $f photos/other/$fname
11         continue;
12     fi
13
14     dir=`echo $d | cut -d/ -f1-2`
15     fname=`basename $f`
16     mkdir -p photos/$dir
17     echo photos/$dir/$fname
18     ln $f photos/$dir/$fname
19 done