(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 ==
  
<code lang='bash'>
+
<pre>
 
#!/bin/bash
 
#!/bin/bash
 
#
 
#
Line 24: Line 24:
  
 
date | tr -d ": " | tr -d "\n"
 
date | tr -d ": " | tr -d "\n"
</code>
+
</pre>

Revision as of 05:51, 26 September 2023

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 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).

Usage

By running it just now, I get:

uniqname
WedAug29194222CEST2012

The WedAug29194222CEST2012 string is a unique timestamp (within 1s of accuracy).

Source

#!/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"