2021-11-25 13:20:13 +01:00
|
|
|
#!/bin/sh -e
|
2021-11-23 14:14:24 +01:00
|
|
|
# Add the modification date in front of the filename
|
2021-11-25 13:20:13 +01:00
|
|
|
IFS='\n'
|
2021-11-23 14:14:24 +01:00
|
|
|
for file
|
2021-11-25 13:20:13 +01:00
|
|
|
do mv --verbose --interactive "$file" \
|
2021-11-25 13:55:44 +01:00
|
|
|
"$(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 14:14:24 +01:00
|
|
|
done
|
2021-11-25 13:20:13 +01:00
|
|
|
# stat --format %y "$file" | cut -d' ' -f1
|