2021-11-25 12:20:13 +00:00
|
|
|
#!/bin/sh -e
|
2021-11-23 13:14:24 +00:00
|
|
|
# Add the modification date in front of the filename
|
2021-11-25 12:20:13 +00:00
|
|
|
IFS='\n'
|
2021-11-23 13:14:24 +00:00
|
|
|
for file
|
2021-11-25 12:20:13 +00:00
|
|
|
do mv --verbose --interactive "$file" \
|
|
|
|
"$(latest "$file" | head -2 | tail -1 | cut -d' ' -f1)_$(echo "$file" | sed 's/20\([0-9]\{2\}\)-\([0-9]\{2\}\)\(-[0-9]\{2\}\)\?_\?//')"
|
2021-11-23 13:14:24 +00:00
|
|
|
done
|
2021-11-25 12:20:13 +00:00
|
|
|
# stat --format %y "$file" | cut -d' ' -f1
|