Last active
August 29, 2015 14:06
-
-
Save dennisheinzen/7585bf0af2f4b0a49641 to your computer and use it in GitHub Desktop.
ticketscript.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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) | |
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