Tuesday, May 8, 2012

Generate random char in bash

I need to generate a huge text.

I'm using bash and I want to convert an integer number like 65 to a char like A.
So I use random value between 0 and 255 (I need all the ASCII table), convert to a char and redirect to a file using >>.
But I cannot make bash interpret the integer as a char.
Like printf("%c", 65) in C++.
But if I try this in bash, it returns 6.

No comments:

Post a Comment