From 48fc2e94f023deb0783befdf970a5ae81e585e48 Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Tue, 5 Dec 2017 15:40:31 +0100 Subject: bishuf: simplistic synchronized shuffing of two files --- bishuf | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 bishuf (limited to 'bishuf') diff --git a/bishuf b/bishuf new file mode 100755 index 0000000..e3560f6 --- /dev/null +++ b/bishuf @@ -0,0 +1,17 @@ +#!/usr/bin/env zsh + +SHUF=$(which shuf) +if [[ $? -ne 0 ]]; then + SHUF=$(which gshuf) + if [[ $? -ne 0 ]]; then + echo "no `shuf` found, exiting" + exit + fi +fi + +F=$(mktemp /tmp/bishuf.XXXXXX) +echo 42 > $F +$SHUF --random-source=$F $1 > $1.shuf +$SHUF --random-source=$F $2 > $2.shuf +rm $F + -- cgit v1.2.3