From 73341722be0c2d5d71283c2044a422794507717a Mon Sep 17 00:00:00 2001 From: Aaron Ball Date: Thu, 1 Oct 2015 23:35:03 -0600 Subject: Added gendata script This script will generate random data to be used for testing the palindrome finder program. --- gendata.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 gendata.sh diff --git a/gendata.sh b/gendata.sh new file mode 100755 index 0000000..8241b97 --- /dev/null +++ b/gendata.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +if [[ -z ${1} ]]; then + echo "Please provide a character count to generate"; + return 1 +fi + +# Create data dir if doesn't exist +datadir='./data' +if [[ ! -d ${datadir} ]]; then + mkdir ${datadir} +fi + + +charcount=${1} +head -c ${charcount} /dev/urandom | base64 | tr -cd 'a-zA-Z0-9' | head -c ${charcount} > ${datadir}/${charcount}.txt -- cgit v1.2.3