#! /bin/bash
# Last edited on 2016-11-07 18:01:52 by stolfilocal

# Renames screenshots with blanks in their names to screenshots 
# without.

ls 'Screenshot at'*.png \
  | gawk \
      ' /Screenshot/ {
          dt=$3; tm=$4;
          gsub(/[-:]/,"",tm);
          gsub(/[.]png/,"",tm);
          printf "mv -vi \"%s\" \"Screenshot-%s-%s.png\"\n", $0, dt, tm;
          next;
        }
        // { printf "** error: \"%s\"\n", $0; }
      ' \
  > .cmds
source .cmds
