Blame view

tools/rand_printable 401 Bytes
Georg Hopp authored
1 2 3 4 5 6 7
#!/bin/sh

function rand_printable() {
	local ECHO="/bin/echo"
	local TR="/usr/bin/tr"
	local HEAD="/usr/bin/head"
8
	${ECHO} -n "`</dev/urandom ${TR} -dc \ -\&\(-~ | ${HEAD} -c${1:-512}`"
Georg Hopp authored
9 10
}
11 12 13 14 15 16
if [ -n "${ZSH_EVAL_CONTEXT}" ]
then
	test "${ZSH_EVAL_CONTEXT}" = "toplevel" && rand_printable "$@"
else
	test "X$(basename -- "$0")" = "Xrand_printable" && rand_printable "$@"
fi
Georg Hopp authored
17 18

# vim: set ft=sh ts=4 sw=4: