On Mon, Dec 21, 2015 at 2:21 PM, Greg Wooledge <wool...@eeg.ccf.org> wrote: > On Sat, Dec 19, 2015 at 12:58:41AM +0100, Piotr Grzybowski wrote: >> #2 >> touch /tmp/`date +%s`; if [ -f /tmp/`date +%s` ]; then echo "ok: $^"; fi; > > This is both wrong (insecure) and clumsy. You can't create a temp file > this way. [..]
It was a clumsy example then. No intention to create temporary file there, so the rest is interesting but a bit off-topic. Personally I always use randomized strings in conjunction with $$. using awk's rand is a poor idea, and you should use as many other sources of randomness as possible, preferably hexdump on /dev/urandom (keeping in mind the difference /dev/random, blocking, etc) if you can. There are implementations of awk that return very poor random numbers. (you see, I read you wiki) Ok, it is off $^ topic, if you do not see the need for it that wraps it up. Thanks for answer. cheers, pg