Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.
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?

share|improve this question

2 Answers 2

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.

share|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

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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