bash - How to echo random amounts of dots mixed with spaces? -


i bash/terminal command make echo

 ...  . . . .  . .  ..  ...... .. . . . 

in other words random amounts of dots perhaps 100 dots max, mixed spaces.

how can done via bash script ?

here 1 liner:

max=$((random%100)); ((i=0;i<max;i++)); ((random%2)) && a="$a." || a="$a "; done; echo "$a" 

or in more readable format:

max=$((random%100)) ((i=0;i<max;i++))      ((random%2)) && a="$a." || a="$a " done echo "$a" 

Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -