rand_printable
401 Bytes
#!/bin/sh
function rand_printable() {
local ECHO="/bin/echo"
local TR="/usr/bin/tr"
local HEAD="/usr/bin/head"
${ECHO} -n "`</dev/urandom ${TR} -dc \ -\&\(-~ | ${HEAD} -c${1:-512}`"
}
if [ -n "${ZSH_EVAL_CONTEXT}" ]
then
test "${ZSH_EVAL_CONTEXT}" = "toplevel" && rand_printable "$@"
else
test "X$(basename -- "$0")" = "Xrand_printable" && rand_printable "$@"
fi
# vim: set ft=sh ts=4 sw=4: