AminetAminet
Search:
84476 packages online
About
Recent
Browse
Search
Upload
Setup
Services

util/time/uniquedate.lha

Mirror:Random
Showing:m68k-amigaosppc-amigaosppc-morphosi386-arosi386-amithlonppc-warpupppc-powerupgeneric
No screenshot available
Short:Generates unique numeric date/timestamps
Author:Alex Carmona
Uploader:AmigaOne theworld net (Alex Carmona)
Type:util/time
Version:1.0
Architecture:ppc-amigaos >= 4.0.0
Date:2006-06-22
Download:http://aminet.net/util/time/uniquedate.lha - View contents
Readme:http://aminet.net/util/time/uniquedate.readme
Downloads:833

UniqueDate is a command which generates a unique numeric date string.
Like my UniqueName utility, it's mostly useful in shell scripts, to avoid name
clashes when creating pipes and filenames, but it may also be useful as a
timestamp for automatically generated files.


Usage:
UniqueName G=GREGORIAN/S

The optional switch, "G" or "GREGORIAN", can be specified to switch
the string output format to a more human-friendly date.

The default format is the number of microseconds since Jan. 1st 1978.
E.g. 898499624016706 or SSSSSSSSSµµµµµµ (1 million µS. = 1 Seconds). 

The Gregorian format is the date and time with microseconds.
E.g. 20060622071344396890 or YYYYMMDDHHMMSSµµµµµµ


Examples: (taken straight from the UniqueName readme... I'm sooo lazy!)

Suppose that each time you run a script you want to log its output to a new
file...

 Execute Script >`UniqueDate G`.log

Perhaps within the script you want to redirect some output to other logfiles...

[Script]
 Set log1 Sys`UniqueDate G`.log
 Set log2 Usr`UniqueDate G`.log
 SomeCommand >>$log1
 SomeCommand >>$log2
 SomeCommand >>$log1
 etc...

You can run the script multiple times in parallel without risking overwriting
 another's log file.

Likewise with named PIPEs...

[Script]
 Set pre PIPE:`UniqueDate`
 Set post PIPE:`UniqueDate`
 Run Capture input=$pre output=$post
 Wait 1
 Run Broadcast source=$post





Contents of util/time/uniquedate.lha
 PERMSSN    UID  GID    PACKED    SIZE  RATIO METHOD CRC     STAMP          NAME
---------- ----------- ------- ------- ------ ---------- ------------ -------------
[generic]                 4407    5061  87.1% -lh5- c7f4 Jun 22 07:40 UniqueDate.info
[generic]                 2567    5184  49.5% -lh5- e0f7 Jun 22 06:55 UniqueDate/UniqueDate
[generic]                  754    1848  40.8% -lh5- 782b Jun 22 06:54 UniqueDate/UniqueDate.c
[generic]                  779    1437  54.2% -lh5- 34ea Jun 22 07:39 UniqueDate/UniqueDate.readme
---------- ----------- ------- ------- ------ ---------- ------------ -------------
 Total         4 files    8507   13530  62.9%            Jun 22 22:09

Aminet © 1992-2024 Urban Müller and the Aminet team. Aminet contact address: <aminetaminet net>