diff --git a/.local/bin/scripts/latest b/.local/bin/scripts/latest index 70605f6..86d77c5 100755 --- a/.local/bin/scripts/latest +++ b/.local/bin/scripts/latest @@ -1,3 +1,3 @@ #!/bin/sh -e # Displays the latest files in the given directory or pwd -find "$1" -maxdepth 4 -type f -printf '%TF %f\n' | sort -r | head +find "${1:-$PWD}" -maxdepth 4 -type f -printf '%.16T+ %P\n' | sort -r | head diff --git a/.local/bin/scripts/predate b/.local/bin/scripts/predate index 7a3fa92..bc13e67 100755 --- a/.local/bin/scripts/predate +++ b/.local/bin/scripts/predate @@ -3,6 +3,6 @@ IFS='\n' for file 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\}\)\?_\?//')" + "$(latest "$file" | head -2 | tail -1 | cut -d'+' -f1)_$(echo "$file" | sed 's/20\([0-9]\{2\}\)-\([0-9]\{2\}\)\(-[0-9]\{2\}\)\?_\?//')" done # stat --format %y "$file" | cut -d' ' -f1