Print a random string or select random elements

view full story

http://wiki.bash-hackers.org – toys This one's a very close variation on Print a horizontal line (credit goes to those guys). You may wish to read it first, as well as The printf command. We're basically exploiting the same printf field width specifier concept to truncate the values of a sequence expansion. (HowTos)