You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
365 B
Bash

6 years ago
#!/bin/sh
# OKI 320 ML tests
# this test is to generate (crap) random 8 pin mode patterns
#PRNG
function rand {
echo "obase=8;`expr $RANDOM % 256`" | bc
}
function randpat {
n=1
while [ $n -le 256 ]; do
RND=`rand`
echo -ne '\'$RND
n=$((n+1))
done
}
PATTERN=`randpat`
# noise
# PATTERN2=`head /dev/urandom -c 1024`
echo -e '^[@^[5^[9^[*1\4'$PATTERN'^[@' | lp -o raw