ref: 3eed9609e23bd0c26e036a7fc48b9a81ea2a750a
dir: /sdrip/archive.rc/
#!/bin/rc . ./fns.rc {lscmd >[2]/dev/null} | awk -F_ 'BEGIN{ dirs["misc"] = 1 } /^misc\./{ printf "mv -n %s %s/img/misc/%s\n", $0, ENVIRON["HOME"], $0 next } { year=substr($1, 1, 4) month=substr($1, 5, 2) dirs[sprintf("%s/%s", year, month)] = 1 printf "mv -n %s %s/img/%s/%s/%s\n", $0, ENVIRON["HOME"], year, month, $0 } END{ for(d in dirs) printf "mkdir -p %s/img/%s\n", ENVIRON["HOME"], d }' | tac