Created
December 8, 2011 11:08
-
-
Save serverhorror/1446732 to your computer and use it in GitHub Desktop.
Print a date string (rather path segment) with the last mtime of an input path
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Print a date string (rather path segment) with the last mtime of an input path | |
function format_mtime() { | |
p = $1 | |
_mtime=$(stat --format="%y" $p) | |
result=$(date -d "$_mtime" "+%Y/%Y-%m/%Y-%m-%d/%Y-%m-%d_%Hh") | |
return result | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment