- Timestamp:
- Jan 16, 2019, 11:49:03 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/c_random.sh
r1 r540 16 16 if test -c "/dev/urandom"; then 17 17 dd if=/dev/urandom ibs=1 count=4 > my_random_file 2>/dev/null 18 nsum=` sum ./my_random_file | awk '{print $1 }' | sed 's%^0*%%g' 2>/dev/null`18 nsum=`cksum ./my_random_file | awk '{print $1 }' | sed 's%^0*%%g' 2>/dev/null` 19 19 if test x$nsum != x; then 20 20 rnd_tst=yes … … 27 27 if test -c "/dev/srandom"; then 28 28 dd if=/dev/srandom ibs=1 count=4 > my_random_file 2>/dev/null 29 nsum=` sum ./my_random_file | awk '{print $1 }' | sed 's%^0*%%g' 2>/dev/null`29 nsum=`cksum ./my_random_file | awk '{print $1 }' | sed 's%^0*%%g' 2>/dev/null` 30 30 if test x$nsum != x; then 31 31 rnd_tst=yes … … 218 218 fi 219 219 # 220 nsum=` sum ./my_random_file | awk '{print $1 }' | sed 's%^0*%%g' 2>/dev/null`220 nsum=`cksum ./my_random_file | awk '{print $1 }' | sed 's%^0*%%g' 2>/dev/null` 221 221 # 222 222 fi 223 223 224 224 # 225 # ' sum' is portable, but only 16bit225 # 'cksum' is more portable than 'sum', but 32 bit 226 226 # 227 227 228 228 /bin/rm -f ./my_random_file 2>/dev/null 229 229 230 echo $nsum 231 232 230 final=`expr $nsum \% 65536` 231 echo $final 232 233
Note:
See TracChangeset
for help on using the changeset viewer.