Menu

#1 Better name suffix for name collision

open
nobody
None
5
2010-05-27
2010-05-27
No

I suggest the following name format:
myfile_20100527-154830.ext

The suffix contains current date and time: 2010 may 05 - 15h 48m 30s
The suffix makes it possible to sort files in trashing time order.

The code to achieve this is:
FinT="${FinT%.*}_$(date '+%Y%m%d-%H%M%S')$(expr \"$FinT\" : '.*\(\..*\)')"
Which should replace the line:
FinT="$(date) ${FinT}"

JL

Discussion


Log in to post a comment.