Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
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
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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .