changeset 9264:119c0d818128

<shachaf> ` cp bin/{wisdom,randbin}; sled \'bin/randbin//s#wisdom#bin#g\'
author HackBot
date Thu, 13 Oct 2016 22:37:06 +0000
parents 576a3c528f0c
children d32852713e15
files bin/randbin
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/bin/randbin	Thu Oct 13 22:34:03 2016 +0000
+++ b/bin/randbin	Thu Oct 13 22:37:06 2016 +0000
@@ -1,1 +1,1 @@
-ls -1 bin | shuf -n 1
+f=$(find bin -ipath "bin/*$1*" -type f -print0 | shuf -z -n1); if [ -n "$f" ]; then echo -n "${f#bin/}//"; cat "$f"; else echo "That's not wise."; fi | rnooodl