Skip to content

Instantly share code, notes, and snippets.

@dennisheinzen
Last active August 29, 2015 14:06
Show Gist options
  • Save dennisheinzen/7585bf0af2f4b0a49641 to your computer and use it in GitHub Desktop.
Save dennisheinzen/7585bf0af2f4b0a49641 to your computer and use it in GitHub Desktop.
ticketscript.sh
#!/bin/sh
##Variables:
# Amount:
amount=10
# Prefix:
PREFIX=061027
#Suffix:
SUFFIX=654321
##Script
#Locale to C, since my mac is on UTF8
export LC_ALL=C
#Header for CSV
echo "Barcode;Ticketcode"
#Loop
for i in `seq 1 $amount`;
do
A=$(cat /dev/urandom | tr -dc 'A-Z' | fold -w 2 | head -n1)
B=$(cat /dev/urandom | tr -dc '0-9' | fold -w 4 | head -n1)
#Print
printf "$PREFIX$A$B$SUFFIX;$A$B"
echo
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment