Jafner.net/dotfiles_gitea/sieve/receipts_compose.sh
2024-06-04 03:04:47 -07:00

14 lines
412 B
Bash
Executable File

#!/bin/bash
# create the subjects variable as a list of space-separated, double-quoted subject line strings
# one per line from the promotions_subjects.txt file
sort -u -o receipts_subjects.txt receipts_subjects.txt
subjects=""
while IFS= read -r line; do
subjects+="\"$line\", "
done < <(cat "receipts_subjects.txt")
subjects="${subjects%, }"
sed "s/receipts_subjects/${subjects}/g" receipts_script.txt