-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrlmd.sh
More file actions
executable file
·25 lines (24 loc) · 778 Bytes
/
rlmd.sh
File metadata and controls
executable file
·25 lines (24 loc) · 778 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash -e
#
# rlmd.sh - read last modified date
#
# sample: find . name \*.md | rlmd.sh
# 201303240636.32 ./Evernote/Semantic Web/Live Microdata.md
# 201303172036.36 ./Evernote/Semantic Web/Best Practice Recipes for Publishing RDF Vocabularies.md
# 201303040627.21 ./Evernote/Semantic Web/Logic Calculator.md
# ...
#
# usage: find . name \*.md | rlmd.sh > modfied.txt # save last modified date and time
# slmd.sh < modified.txt # restore last modified date and time
#
# tested on:
# - macOS 14.1.2 (Sonoma)
#
# https://github.com/muhme/scripts
# hlu, Dec 15th 2023
# MIT license
# read standard input line by line
while IFS= read -r file; do
original_date=$(stat -f "%Sm" -t "%Y%m%d%H%M.%S" "$file")
echo "${original_date} ${file}"
done