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?

link|improve this question
feedback

2 Answers

up vote 2 down vote accepted

Try this:

for i in `seq 10` ; do <your command here> ; done

it will repeat <your command here> 10 times.

link|improve this answer
Works xD (15 characters) – Phil Aug 17 '10 at 19:03
1  
@Phil: With Bash, it's not necessary to use seq. You can do for i in {1..10} or for ((i=1;i<=10;i++)) and it saves forking another external executable. – Dennis Williamson Aug 17 '10 at 19:08
@Dennis: Sure, you've right, but this job doesn't seem a time-critical task. – cYrus Aug 17 '10 at 19:15
feedback

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.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.