Skip to content

Instantly share code, notes, and snippets.

@ghoulmann
Created March 14, 2013 13:26
Show Gist options
  • Save ghoulmann/5161279 to your computer and use it in GitHub Desktop.
Save ghoulmann/5161279 to your computer and use it in GitHub Desktop.
Mass QR-code generation using qrencode
#!/bin/bash
#To do: configure install for $1
#To do: move script to acceptable path
#To do: generate conf in /etc for variables
#To do: SOLVE: last line must be \n or blank. We got something wrong.
list="./url-list.txt" #variable called list is a file in the current directory
URLS=$(cat $list) #creates var called URLS from file
i=0 #new variable to iterete and increment
#loop
printf %s "$URLS" | while IFS= read -r line
do
for url in $line
do
i=$(( $i + 1)) #increment
#echo "echo URL is $line" #troubleshooting
qrencode -s 5 -m 5 -o "./qr/$i.png" "$url" #create qr and stuff in subfolder called qr w/ a number equal to #i
echo "created ./qr/$i.png" #troubleshooting
#echo "total qr codes generated is $i" #troubleshooting
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment