#!/bin/bash set -euo pipefail QRC="images.qrc" IMG_DIR="img" cat <"$QRC" EOF find "$IMG_DIR" -type f | while IFS= read -r file; do printf " %s\n" "$file" >>"$QRC" done cat <>"$QRC" EOF