Skip to main content

Thread: unique id


how go assigning unique id each time script runs?
reason asking because make new file whenever script runs, need keep old one. example:
code:
first time run script, want file called: 001.foo second time, want file called: 002.foo  , on...
how can make happen?

edit: never mind, realized not helpful script

i realize realized don't need it, shell variable $$ expanded process id.

in script

code:
echo "test" > hello.$$
would produce file name hello.21345 example.


Forum The Ubuntu Forum Community Ubuntu Official Flavours Support General Help [SOLVED] unique id


Ubuntu

Comments