From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id C05A5138262 for ; Tue, 24 May 2016 02:05:39 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 641921424B; Tue, 24 May 2016 02:05:38 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id A8B301424B for ; Tue, 24 May 2016 02:05:37 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id C8A94340BD1 for ; Tue, 24 May 2016 02:05:36 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 3AAE397C for ; Tue, 24 May 2016 02:05:34 +0000 (UTC) From: "Mike Frysinger" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" Message-ID: <1464055231.b86673c79105fa3cfd5ec84e6d1e052587f9f96b.vapier@gentoo> Subject: [gentoo-commits] proj/releng:master commit in: tools/ X-VCS-Repository: proj/releng X-VCS-Files: tools/catalyst-auto X-VCS-Directories: tools/ X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: b86673c79105fa3cfd5ec84e6d1e052587f9f96b X-VCS-Branch: master Date: Tue, 24 May 2016 02:05:34 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 7f42a5cb-1fde-4a48-9c9e-7b4fa3af726f X-Archives-Hash: 99b1832b290d16761a29fb147d11eaab commit: b86673c79105fa3cfd5ec84e6d1e052587f9f96b Author: Mike Frysinger gentoo org> AuthorDate: Tue May 24 02:00:31 2016 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Tue May 24 02:00:31 2016 +0000 URL: https://gitweb.gentoo.org/proj/releng.git/commit/?id=b86673c7 catalyst-auto: convert `echo -e` to `printf` Makes the code a bit more robust. tools/catalyst-auto | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/catalyst-auto b/tools/catalyst-auto index beb7aa8..de1b10d 100755 --- a/tools/catalyst-auto +++ b/tools/catalyst-auto @@ -61,12 +61,14 @@ send_email() { logfile=$3 if [ -n "${logfile}" ]; then - body=$(echo -e "${message}\n\n"; tail -n 200 "${logfile}"; echo -e "\n\n\nFull build log at ${logfile}") + body=$(printf '%b\n\n\n' "${message}"; tail -n 200 "${logfile}"; printf '\n\n\nFull build log at %s\n' "${logfile}") else body=${message} fi - echo -e "From: ${EMAIL_FROM}\r\nTo: ${EMAIL_TO}\r\nSubject: ${subject}\r\n\r\n${body}" | /usr/sbin/sendmail -f ${EMAIL_FROM} ${EMAIL_TO//,/ } + printf 'From: %s\r\nTo: %s\r\nSubject: %s\r\n\r\n%b' \ + "${EMAIL_FROM}" "${EMAIL_TO}" "${subject}" "${body}" | \ + /usr/sbin/sendmail -f "${EMAIL_FROM}" ${EMAIL_TO//,/ } } run_cmd() {