From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 47840BA34 for ; Tue, 7 Mar 2023 17:30:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A07C6C433EF; Tue, 7 Mar 2023 17:30:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1678210236; bh=nZshh1ZyEQJv277/Thigk5vwlmw8s762KE1ZEDVSrAU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VHgAKJtcyWZngGDwTtm8XitdVitArpkz1mvXsDc+K+JA7cxsSG7+DcVgXhiid4DA1 Hj7Gb2V7gN9KCPFkIkEtPLf1ZF80XLeARo/J45B/qsqnBlzXfb51VJA6SugDNxyYbR pqh4u8RbfG/5U7zWzASHULWPm/vRJIbw4krNINlU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, "kernelci.org bot" , David Laight , Guillaume Tucker , Guenter Roeck , Shuah Khan , Sasha Levin Subject: [PATCH 6.2 0476/1001] selftests: use printf instead of echo -ne Date: Tue, 7 Mar 2023 17:54:08 +0100 Message-Id: <20230307170042.059907292@linuxfoundation.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307170022.094103862@linuxfoundation.org> References: <20230307170022.094103862@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Guillaume Tucker [ Upstream commit 9e34fad00fc889abbb99d751a4c22cf2bded10df ] Rather than trying to guess which implementation of "echo" to run with support for "-ne" options, use "printf" instead of "echo -ne". It handles escape characters as a standard feature and it is widespread among modern shells. Reported-by: "kernelci.org bot" Suggested-by: David Laight Fixes: 3297a4df805d ("kselftests: Enable the echo command to print newlines in Makefile") Fixes: 79c16b1120fe ("selftests: find echo binary to use -ne options") Signed-off-by: Guillaume Tucker Reviewed-by: Guenter Roeck Signed-off-by: Shuah Khan Signed-off-by: Sasha Levin --- tools/testing/selftests/Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile index 9619d0f3b2ffb..06578963f4f1d 100644 --- a/tools/testing/selftests/Makefile +++ b/tools/testing/selftests/Makefile @@ -234,11 +234,10 @@ ifdef INSTALL_PATH @# While building kselftest-list.text skip also non-existent TARGET dirs: @# they could be the result of a build failure and should NOT be @# included in the generated runlist. - ECHO=`which echo`; \ for TARGET in $(TARGETS); do \ BUILD_TARGET=$$BUILD/$$TARGET; \ - [ ! -d $(INSTALL_PATH)/$$TARGET ] && $$ECHO "Skipping non-existent dir: $$TARGET" && continue; \ - $$ECHO -ne "Emit Tests for $$TARGET\n"; \ + [ ! -d $(INSTALL_PATH)/$$TARGET ] && printf "Skipping non-existent dir: $$TARGET\n" && continue; \ + printf "Emit Tests for $$TARGET\n"; \ $(MAKE) -s --no-print-directory OUTPUT=$$BUILD_TARGET COLLECTION=$$TARGET \ -C $$TARGET emit_tests >> $(TEST_LIST); \ done; -- 2.39.2