Link to home
Start Free TrialLog in
Avatar of e-muzica
e-muzica

asked on

bash random string

How can i create in bash a random string of 80 characters like nAHSU987ASNnnn9sdnasus9dha87ajdJNo7988
ASKER CERTIFIED SOLUTION
Avatar of ravenpl
ravenpl
Flag of Poland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of e-muzica
e-muzica

ASKER

i waant to contain only numbers and letters
Then there is no simple tool(so far I know)
One more(but no upper chars):
RSTR=$( ( uuidgen; uuidgen; uuidgen ) | tr "\n-" "xX" | head -c 80 )

and finally, but this is in fact perl programm
RSTR$( perl -e 'while($c<80){ $v=rand(123); next if ($v<48||($v>57&&$v<65)||($v>90&&$v<97)); print(chr($v)); $c++}' )
( ( uuidgen; uuidgen; uuidgen ) | tr "\n-" "xX" | head -c 80 ) is great, thx