IFS=$'\n'; for spell in $(cat spells.txt | grep -P "^#\d+" | sed 's/#//g' | sed 's/!.\+\?$//g'); do grep -P "\[\"$spell-" ../WeakAurasIridian.lua > out/$spell.txt; grep -P "\[\"$spell-" ../WeakAurasPhatphuckdave.lua >> out/$spell.txt; done