summaryrefslogtreecommitdiffstats
path: root/local/bin/rename_pictures.sh
blob: a3f24630102ae6a4ff48f03d22ba5c34e8a936cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash

# Very specific script to bulk rename pictures with some format
# (complex script for a simple task)

exit    # just in case

shopt -s nullglob
for file in ss_*.png; do
    date_part="${file:3:8}"
    time_part="${file:12:6}"
    new_name="ss-${date_part}T${time_part}0500.png"

    mv "$file" "$new_name"
done
shopt -u nullglob