#!/bin/bash # Check if a value is provided as an argument if [ -z "$1" ]; then echo "Please provide a value to encode into the QR code." exit 1 fi # The value to encode into a QR code value="$1" # Output filename for the QR code image output_file="${2:-myqr.png}" # Generate the QR code using qrencode and save it as a PNG qrencode -o "$output_file" "$value" echo "QR code saved to $output_file"