From 8db01713f1f45ae38066b9da307e90eda40c43c8 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Mon, 22 Sep 2008 17:46:38 +0200 Subject: [PATCH] tg mail: Simplify array usage --- tg-mail.sh | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/tg-mail.sh b/tg-mail.sh index cf68155..7e394b8 100644 --- a/tg-mail.sh +++ b/tg-mail.sh @@ -37,16 +37,14 @@ from="$(echo "$header" | grep '^From:' | sed 's/From:\s*//')" to="$(echo "$header" | grep '^To:' | sed 's/To:\s*//')" -# XXX I can't get quoting right without arrays -[ -n "$from" ] && from=(--from "$from") -[ -n "$to" ] && to=(--to "$to") # FIXME there could be multimple To - +# XXX: I can't get quoting right without arrays people=() -[ -n "$from" ] && people=("${people[@]}" "${from[@]}") -[ -n "$to" ] && people=("${people[@]}" "${to[@]}") +[ -n "$from" ] && people=("${people[@]}" --from "$from") +# FIXME: there could be multimple To +[ -n "$to" ] && people=("${people[@]}" --to "$to") -# NOTE git-send-email handles cc itself +# NOTE: git-send-email handles cc itself git send-email "${people[@]}" "$patchfile" rm "$patchfile" -- 2.30.2