(Created page with "= UniqName = '''uniqname''' is an extremely simple script to generate a timestamp that can be used to define labels, filenames, variables, etc., which are unique if not invok...") |
m (→Source) |
||
Line 16: | Line 16: | ||
== Source == | == Source == | ||
− | < | + | <pre> |
#!/bin/bash | #!/bin/bash | ||
# | # | ||
Line 24: | Line 24: | ||
date | tr -d ": " | tr -d "\n" | date | tr -d ": " | tr -d "\n" | ||
− | </ | + | </pre> |
uniqname is an extremely simple script to generate a timestamp that can be used to define labels, filenames, variables, etc., which are unique if not invoked more than once per second.
A typical use is as a label in $\mathrm{\TeX}$ documents, or as a filename for temporary documents or quick notes (today, for instance, I sent a file called "WedAug29164757CEST2012.pdf" to co-workers).
By running it just now, I get:
uniqname WedAug29194222CEST2012
The WedAug29194222CEST2012 string is a unique timestamp (within 1s of accuracy).
#!/bin/bash # # Unique Name generator based on date # F.P. Laussy # Fri May 6 10:27:47 UTC 2005 date | tr -d ": " | tr -d "\n"