machine text: selecting a random line from a file
@hilary was experimenting with selecting a random line from a file. there were many excellent contributions to the discussion. here’s my convoluted approach.
dd if=file.txt skip=$(expr $(date +%N) \% $(stat -c “%s” file.txt)) ibs=1 count=200 2>/dev/null | sed -n ‘2{p;q;}’
it uses “dd”…
Ha! Posts like these are why Forrst exists :)
-
whitneymcn liked this
-
ethanhein liked this
-
j2d2 liked this
-
innonate reblogged this from machinetext and added:
“dd”… Ha! Posts like these...Forrst exists :)
-
machinetext posted this
Short URL for this post: http://tmblr.co/ZZ2aby4fvVoX