You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
401 B
18 lines
401 B
#!/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:
|