3 bup_python="$(dirname "$0")/bup-python" || exit $?
4 exec "$bup_python" "$0" ${1+"$@"}
8 from bup import options, _helpers
9 from bup.helpers import *
12 bup random [-S seed] <numbytes>
14 S,seed= optional random number seed [1]
15 f,force print random data to stdout even if it's a tty
16 v,verbose print byte counter to stderr
18 o = options.Options(optspec)
19 (opt, flags, extra) = o.parse(sys.argv[1:])
22 o.fatal("exactly one argument expected")
24 total = parse_num(extra[0])
28 if opt.force or (not os.isatty(1) and
29 not atoi(os.environ.get('BUP_FORCE_TTY')) & 1):
30 _helpers.write_random(sys.stdout.fileno(), total, opt.seed,
31 opt.verbose and 1 or 0)
33 log('error: not writing binary data to a terminal. Use -f to force.\n')