um-mode/bash/last/last.sh
2024-01-11 10:52:52 -08:00

9 lines
278 B
Shell
Executable file

# Get the last file name of any numbered series of text files.
# file format:
# in regex terms:
# [0-9]+\.[.*\.]*md|txt
# in plain terms:
# [leading numbers with consistent width].[optional string descriptor and . separator][md|txt]
ls | egrep '^\d.*\.md|txt' | tail -n 1