Средствами самого bash - никак.
А вообще R=$(dd if=/dev/random bs=1 count=...)
Правда если конечные байты будут \n, то они потеряются, байты \x00 тоже пропадут.
А ещё в bash есть псевдопеременная RANDOM.
ну как бы потому, что и микроскопом, поговаривают, гвозди забиваются, но всё же:
man openssl:
DESCRIPTION
OpenSSL is a cryptography toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer
Security (TLS v1) network protocols and related cryptography standards required by them.
The openssl program is a command line tool for using the various cryptography functions of OpenSSL's
crypto library from the shell.
и man dd:
DESCRIPTION
Copy a file, converting and formatting according to the operands.