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

util/crypt/uniquename.lha

Mirror:Random
Showing: i386-aros icongeneric icon
No screenshot available
Short:Generates unique (random) strings
Author:Alex Carmona
Uploader:AmigaOne theworld net (Alex Carmona)
Type:util/crypt
Version:1.0
Architecture:ppc-amigaos
Date:2006-06-23
Download:util/crypt/uniquename.lha - View contents
Readme:util/crypt/uniquename.readme
Downloads:830

Based on Fredrik Wikstrom's mkpasswd utility

Description:
UniqueName is a command that generates a random and (hopefully) unique
alphanumeric string.
It's mostly useful in shell scripts, to avoid name clashes when creating pipes
and filenames.


Usage:
UniqueName <length>

The command accepts a single (optional) argument, the length of the string to
be generated.

Length should be a value between 4 and 40.

It defaults to 8 if no value was specified.

Any other argument will return the usage template.

The minimum length of 4 characters represents over 1.6 million (36*36*36*36)
possibilities and should be safe enough for its intended use.
With 8 chars you get over 2.8 trillion possibilities, and if you're really
paranoid (nuts?), use 40, that represents over...
1600000000000000000000000000000000000000000000000000000000000 possibilities!


Examples:

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

 Execute Script >`UniqueName`.log

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

[Script]
 Set log1 Sys`UniqueName 4`.log
 Set log2 Usr`UniqueName 4`.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:`UniqueName`
 Set post PIPE:`UniqueName`
 Run Capture input=$pre output=$post
 Wait 1
 Run Broadcast source=$post





Contents of util/crypt/uniquename.lha
 PERMSSN    UID  GID    PACKED    SIZE  RATIO METHOD CRC     STAMP          NAME
---------- ----------- ------- ------- ------ ---------- ------------ -------------
[generic]                 4407    5061  87.1% -lh5- e2bf Jun 21 22:48 UniqueName.info
[generic]                 2707    5240  51.7% -lh5- 7283 Jun 21 23:53 UniqueName/UniqueName
[generic]                  933    2270  41.1% -lh5- 4aee Jun 21 23:49 UniqueName/UniqueName.c
[generic]                  776    1528  50.8% -lh5- 60a2 Jun 22 01:06 UniqueName/UniqueName.readme
---------- ----------- ------- ------- ------ ---------- ------------ -------------
 Total         4 files    8823   14099  62.6%            Jun 22 22:09
Page generated in 0.02 seconds
Aminet © 1992-2024 Urban Müller and the Aminet team. Aminet contact address: <aminetaminet net>