Quote:
Originally posted by gumby
How would I generate a unique id string within a Bash shell?
|
- If it doen't need to be random, but just unique, how about a simple counter? Increase by 1 each time you need another identifier, padding with zero's if you need the id's to be fixed length strings.
- If you just need one unique id for each instance of the script, how about it's process id? You get it (in bash/sh) easily with the $$-variable, e.g. "echo $$".
(or maybe I didn't get your question right?)