summaryrefslogtreecommitdiff
path: root/gendata.sh
blob: 8241b97e49f5d1a8fd194c58ad4e858cc0e22dbc (plain)
    1 #!/usr/bin/env bash
    2 
    3 if [[ -z ${1} ]]; then
    4   echo "Please provide a character count to generate";
    5   return 1
    6 fi
    7 
    8 # Create data dir if doesn't exist
    9 datadir='./data'
   10 if [[ ! -d ${datadir} ]]; then
   11   mkdir ${datadir}
   12 fi
   13 
   14 
   15 charcount=${1}
   16 head -c ${charcount} /dev/urandom | base64 | tr -cd 'a-zA-Z0-9' | head -c ${charcount} > ${datadir}/${charcount}.txt

Generated by cgit