2
dd if=/dev/urandom count=200 bs=1 2>/dev/null|tr "\n" " "|sed 's/[^a-zA-Z0-9]//g'|cut -c-16
How do I repeat it set number of times?
2
dd if=/dev/urandom count=200 bs=1 2>/dev/null|tr "\n" " "|sed 's/[^a-zA-Z0-9]//g'|cut -c-16
How do I repeat it set number of times?
2
Try this:
for i in `seq 10` ; do <your command here> ; done
it will repeat <your command here>
10 times.
2
If the point is to learn shell programming, see cYrus's answer.
If the point is to generate a password, many distributions ship with pwgen.
Works xD (15 characters) – Phil – 2010-08-17T19:03:46.977
1@Phil: With Bash, it's not necessary to use
seq
. You can dofor i in {1..10}
orfor ((i=1;i<=10;i++))
and it saves forking another external executable. – Paused until further notice. – 2010-08-17T19:08:37.543@Dennis: Sure, you've right, but this job doesn't seem a time-critical task. – cYrus – 2010-08-17T19:15:54.970