DEV Community

Ebenezer Lamptey
Ebenezer Lamptey

Posted on

2

Saving Time: Batch QR Code Generation with Bash

Ever found yourself manually creating QR codes one by one? As a choir marketing committee member, I was frustrated with online tools that either:

  • Limit free users to one QR code
  • Charge for bulk generation
  • Waste precious time

The Frustration

Our choir needed QR codes for multiple YouTube links to print on marketing t-shirts. Existing solutions? Painfully slow and expensive.

The Bash Solution

I wrote a simple script to automate QR code generation:

bash

# Check if input file is provided
if [ -z "$1" ]; then
    echo "Usage: $0 <input_file>"
    exit 1
fi

input_file="$1"

# Create a directory to store QR codes
mkdir -p qr_codes

# Generate QR codes for each URL in the input file
while IFS= read -r url; do
    filename="qr_codes/$(basename "$url").png"
    qrencode -o "$filename" "$url"
    echo "Generated QR code for $url"
done < "$input_file"

echo "QR codes saved in 'qr_codes' directory."

Enter fullscreen mode Exit fullscreen mode

Key Benefits

  • Free
  • Fast
  • Customizable
  • No subscription needed

How It Works

  • Create a text file with URLs
  • Run the script
./qr_code.sh <text file>

Enter fullscreen mode Exit fullscreen mode

Get QR codes in seconds

Pro Tips

  • Use with qrencode
  • Works for any links, not just YouTube
  • Easily scriptable and modifiable

You can see the code in my github
https://github.com/nlankwei5/Create-Qr-code/blob/main/qr_code.sh

Feel free to try it and give comments for more improvements
No more manual, repetitive work. 🚀

Top comments (0)

Tiger Data image

🐯 🚀 Timescale is now TigerData: Building the Modern PostgreSQL for the Analytical and Agentic Era

We’ve quietly evolved from a time-series database into the modern PostgreSQL for today’s and tomorrow’s computing, built for performance, scale, and the agentic future.

So we’re changing our name: from Timescale to TigerData. Not to change who we are, but to reflect who we’ve become. TigerData is bold, fast, and built to power the next era of software.

Read more

👋 Kindness is contagious

Explore this insightful write-up, celebrated by our thriving DEV Community. Developers everywhere are invited to contribute and elevate our shared expertise.

A simple "thank you" can brighten someone’s day—leave your appreciation in the comments!

On DEV, knowledge-sharing fuels our progress and strengthens our community ties. Found this useful? A quick thank you to the author makes all the difference.

Okay