From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id qDIsNR7BEmKmhwAAgWs5BA (envelope-from ) for ; Sun, 20 Feb 2022 23:30:54 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id yMbfMR7BEmLhggEAauVa8A (envelope-from ) for ; Sun, 20 Feb 2022 23:30:54 +0100 Received: from mail.notmuchmail.org (yantan.tethera.net [IPv6:2a01:4f9:c011:7a79::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 4F6743B2CF for ; Sun, 20 Feb 2022 23:30:54 +0100 (CET) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id E8B015F401; Sun, 20 Feb 2022 22:30:51 +0000 (UTC) Received: from lahtoruutu.iki.fi (lahtoruutu.iki.fi [IPv6:2a0b:5c81:1c1::37]) by mail.notmuchmail.org (Postfix) with ESMTPS id 25EB75E013 for ; Sun, 20 Feb 2022 22:30:49 +0000 (UTC) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: too) by lahtoruutu.iki.fi (Postfix) with ESMTPSA id 01A251B001B4; Mon, 21 Feb 2022 00:30:48 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1645396248; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=Wi6ZfWX/pRhcZP690xhLs7w+E5cFWgYOOqnYYTHTuKc=; b=GtzUSA0VrxrrCVqdWcC5/0mc41NzK3tJByOUy/VIUEwIb71QY8lVIbfuIo66bYUz7HhwlD r4Yl1ZQgNG0I6kMtMZ0OHkCJ95goma9G7VUQvNJdpe1mgRfVM0AVQxdPK7QFJHToLiH+My XpVTAUHQokIjEsIk6POug2XWbhLvr4tAYzPEa0UA6i3/O3lG12lZ/Fj1y+QZFuQlROpx47 ib8Cx4etvjvBHiVmEsiagfLh5L1CYWEfKaig2onHm4nkf6XN/AFg+vumCrF2u9zXVN/BbT Rzf31M4emyXtFxgjY/wobi7oLvtNrBBnUNuClaBoQgggSOlQmEPMccDDqtdWMg== From: Tomi Ollila To: notmuch@notmuchmail.org Subject: [PATCH v3] removed use of 'echo -n' (and echo -n -e ...) Date: Mon, 21 Feb 2022 00:30:45 +0200 Message-Id: <20220220223045.19103-1-tomi.ollila@iki.fi> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=too smtp.mailfrom=tomi.ollila@iki.fi ARC-Seal: i=1; s=lahtoruutu; d=iki.fi; t=1645396248; a=rsa-sha256; cv=none; b=GOV1cIA4fVPyC366jgIoyhFav0BL7KhrnhCr5iZpqcdocHOubtf3MXiMVVFTH4g2pt5RpA zmaS7x2JKrrHf/6seqmD/9rxiYoKKpB9mVkaUA7edKI9WEiHtLNQu3oQCj+L/XGfeNzNiB jq6dR2c1WYaRDdQRhtnEn5u8fIJGbsv/yXqXkxKXFUni5eb+s41uqnVW2VJz0VVnr5PVdV LZ/jUamoRmmZCPo3rasW41urKV423uSMDnNn6mz19KwrRMwbH0bOSrdeDnt0+hOAKexIV9 bXh3Lsqb+I1/pcLpY4u+Bt5l2opkaVQZLB8CCb4XvFbI28mf3sbUHJkp90Qaqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1645396248; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=Wi6ZfWX/pRhcZP690xhLs7w+E5cFWgYOOqnYYTHTuKc=; b=MNwA7ZC2/J2SuYXIpwmwn5ac1FQiIO94OAK5nye3/LyKgR+b5i4LwhEOXnRWhDW0wXzkVx kyxVXMSAcMbQDZ2ciuOIOzGPxe7ld1FbiiDndyd64NSIMJPGyQYRTlYVIPgFQvk9ZrrGBZ nXTwYjlWBXocSpFy3qP6lIXs9ZV43wN9PxQQO4Rx5LdHiWgB5WFnuiez6P2Ibq92vRJDSd 5ZYwSaJJR46KP/gFgvBu1ip+RvBjxHuPbqA0X+itlVlzP/2cJ+7XVZiPnVoHzcaghJ4i0F Uou/LACvpo4DM5p0cIxNsYK5pTqgWd7WKJKfBa9Yh/S4R2cnBC8lBPJA5P9r6g== Message-ID-Hash: SOT3NWM3UIIYVZFJEWP447OCSV4W62ZV X-Message-ID-Hash: SOT3NWM3UIIYVZFJEWP447OCSV4W62ZV X-MailFrom: tomi.ollila@iki.fi X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN X-Migadu-Country: DE ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1645396254; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=Qr7i5DIxgf8awJo4Qn314wGzWc8Cy1VN/TV/XDGUpRo=; b=DoEo3BgCak09cvUj2NvgMpWJpmURWUwMfZfx7fisF/WryXoqTL5TsQm/xhJ0l/DjrSal3O J2Q1qH2Z71fsreOdRCv80uZO2ImW3jCKSDleNtEA/3cTmrm55MMD3GQSLVAjv2zBPEQmSY Z2DRXm510tVr0fb/hNkzd3pkIIZeaczjTZl2382pLCPfrdr2roDXbz46s4NOZnp+S26VOy w5bGJ0F0U15bp+sq72rw8C03Ww9up5urz84uVGXm0jaWzlfYnaZBkAx7L08CMxoP5sPp+6 Cn0d1JIRmvu61N9bJBHIIMYNkxvk8E/9e4t2QSmqN4bUS+8thgrE80OkYAEZlA== ARC-Seal: i=2; s=key1; d=yhetil.org; t=1645396254; a=rsa-sha256; cv=fail; b=k9qRB1uw5xHTebr2TcomsT6CCRRG5E2Pg+ZeiR/oJ/Jgh3FbxJWw3YC8hvs9cQBLH3R7hK T2ViAzmbBzr+xG5wsEvfZNHBPY4X3lz2YXUdbwdzVu7FUlOp4yBPSKxy6vn4kDKOaO24vy I3jhktVJwEoT78G0hzGxnpiOu8cNDSWIaMeesSdbi74q9HR3/SbYlURgl8HXV072Sd0JJX +eaX9pn1sAv+IQN3T8Wza/HbTKix9YAlV2VeG/+zN8YCQpYIrHeV7Y5LI8tmuM8Al/cg4h b3d0cy5KGT/uaFcupV5Ti2cO2tajgRj7Cv0kGputizMuNAYpF5AO3AOK7lrGAw== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=iki.fi header.s=lahtoruutu header.b=GtzUSA0V; arc=reject ("signature check failed: fail, {[1] = sig:iki.fi:reject}"); dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: 0.65 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=iki.fi header.s=lahtoruutu header.b=GtzUSA0V; arc=reject ("signature check failed: fail, {[1] = sig:iki.fi:reject}"); dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 4F6743B2CF X-Spam-Score: 0.65 X-Migadu-Scanner: scn1.migadu.com X-TUID: ooODJi7U9pRO In most cases used printf %s ... instead. echo -n > file lines to create empty / truncate files were changed to : > file lines, like done in in test-lib-emacs.sh And one echo -n " " replaced with use of sed "s/^/ /" in next line. --- Replaces v2 id:20220220210111.17653-1-tomi.ollila@iki.fi v3 removed 2 trailing spaces in one echoed output, which were added at v1 but forgot to remove in v2. In v3 the quotes in sed line changed from '...' to "..." to be consistent with surrounding code. Makefile.local | 5 ++--- devel/release-checks.sh | 20 ++++++++++---------- test/T090-search-output.sh | 2 +- test/T190-multipart.sh | 2 +- test/T380-atomicity.sh | 4 ++-- 5 files changed, 16 insertions(+), 17 deletions(-) diff --git a/Makefile.local b/Makefile.local index 10fb9908..8fb94b58 100644 --- a/Makefile.local +++ b/Makefile.local @@ -120,8 +120,7 @@ release-message: @echo "Which can be verified with:" @echo "" @echo " $(RELEASE_URL)/$(SHA256_FILE)" - @echo -n " " - @cat releases/$(SHA256_FILE) + @sed "s/^/ /" releases/$(SHA256_FILE) @echo "" @echo " $(RELEASE_URL)/$(DETACHED_SIG_FILE)" @echo " (signed by `getent passwd "$$USER" | cut -d: -f 5 | cut -d, -f 1`)" @@ -169,7 +168,7 @@ release-checks: .PHONY: verify-newer verify-newer: - @echo -n "Checking that no $(VERSION) release already exists..." + @printf %s "Checking that no $(VERSION) release already exists..." @wget -q --no-check-certificate -O /dev/null $(RELEASE_URL)/$(TAR_FILE) ; \ case $$? in \ 8) echo "Good." ;; \ diff --git a/devel/release-checks.sh b/devel/release-checks.sh index 23c29eaa..c0accf78 100755 --- a/devel/release-checks.sh +++ b/devel/release-checks.sh @@ -59,7 +59,7 @@ readonly VERSION # In the rest of this file, tests collect list of errors to be fixed -echo -n "Checking that git working directory is clean... " +printf %s "Checking that git working directory is clean... " git_status=`git status --porcelain` if [ "$git_status" = '' ] then @@ -77,7 +77,7 @@ verfail () append_emsg " Please follow the instructions in RELEASING to choose a version" } -echo -n "Checking that '$VERSION' is good with digits and periods... " +printf %s "Checking that '$VERSION' is good with digits and periods... " case $VERSION in *[!0-9.]*) verfail "'$VERSION' contains other characters than digits and periods" ;; @@ -88,7 +88,7 @@ case $VERSION in *) verfail "'$VERSION' is a single number" ;; esac -echo -n "Checking that this is Debian package for notmuch... " +printf %s "Checking that this is Debian package for notmuch... " read deb_notmuch deb_version rest < debian/changelog if [ "$deb_notmuch" = 'notmuch' ] then @@ -98,7 +98,7 @@ else append_emsg "Package name '$deb_notmuch' is not 'notmuch' in debian/changelog" fi -echo -n "Checking that Debian package version is $VERSION-1... " +printf %s "Checking that Debian package version is $VERSION-1... " if [ "$deb_version" = "($VERSION-1)" ] then @@ -108,7 +108,7 @@ else append_emsg "Version '$deb_version' is not '($VERSION-1)' in debian/changelog" fi -echo -n "Checking that python bindings version is $VERSION... " +printf %s "Checking that python bindings version is $VERSION... " py_version=`python3 -c "with open('$PV_FILE') as vf: exec(vf.read()); print(__VERSION__)"` if [ "$py_version" = "$VERSION" ] then @@ -118,7 +118,7 @@ else append_emsg "Version '$py_version' is not '$VERSION' in $PV_FILE" fi -echo -n "Checking that NEWS header is tidy... " +printf %s "Checking that NEWS header is tidy... " if [ "`exec sed 's/./=/g; 1q' NEWS`" = "`exec sed '1d; 2q' NEWS`" ] then echo Yes. @@ -132,7 +132,7 @@ else fi fi -echo -n "Checking that this is Notmuch NEWS... " +printf %s "Checking that this is Notmuch NEWS... " read news_notmuch news_version news_date < NEWS if [ "$news_notmuch" = "Notmuch" ] then @@ -142,7 +142,7 @@ else append_emsg "First word '$news_notmuch' is not 'Notmuch' in NEWS file" fi -echo -n "Checking that NEWS version is $VERSION... " +printf %s "Checking that NEWS version is $VERSION... " if [ "$news_version" = "$VERSION" ] then echo Yes. @@ -154,7 +154,7 @@ fi #eval `date '+year=%Y mon=%m day=%d'` today0utc=`date --date=0Z +%s` # gnu date feature -echo -n "Checking that NEWS date is right... " +printf %s "Checking that NEWS date is right... " case $news_date in '('[2-9][0-9][0-9][0-9]-[01][0-9]-[0123][0-9]')') newsdate0utc=`nd=${news_date#\\(}; date --date="${nd%)} 0Z" +%s` @@ -176,7 +176,7 @@ case $news_date in esac year=`exec date +%Y` -echo -n "Checking that copyright in documentation contains 2009-$year... " +printf %s "Checking that copyright in documentation contains 2009-$year... " # Read the value of variable `copyright' defined in 'doc/conf.py'. copyrightline=$(grep ^copyright doc/conf.py) case $copyrightline in diff --git a/test/T090-search-output.sh b/test/T090-search-output.sh index bf28d220..0d85c609 100755 --- a/test/T090-search-output.sh +++ b/test/T090-search-output.sh @@ -435,7 +435,7 @@ test_expect_equal_file EXPECTED OUTPUT test_begin_subtest "search for non-existent message prints nothing" notmuch search "no-message-matches-this" > OUTPUT -echo -n >EXPECTED +: >EXPECTED test_expect_equal_file EXPECTED OUTPUT test_begin_subtest "search --format=json for non-existent message prints proper empty json" diff --git a/test/T190-multipart.sh b/test/T190-multipart.sh index 3545a599..d3b7f87c 100755 --- a/test/T190-multipart.sh +++ b/test/T190-multipart.sh @@ -683,7 +683,7 @@ test_expect_equal_json "$(cat OUTPUT)" "$(cat EXPECTED)" test_begin_subtest "'notmuch show --part' does not corrupt a part with CRLF pair" notmuch show --format=raw --part=3 id:base64-part-with-crlf > crlf.out -echo -n -e "\xEF\x0D\x0A" > crlf.expected +printf "\xEF\x0D\x0A" > crlf.expected test_expect_equal_file crlf.out crlf.expected diff --git a/test/T380-atomicity.sh b/test/T380-atomicity.sh index afe49d93..0f9e6d2e 100755 --- a/test/T380-atomicity.sh +++ b/test/T380-atomicity.sh @@ -71,8 +71,8 @@ if test_require_external_prereq gdb; then # Check output against golden output outcount=$(cat outcount) - echo -n > searchall - echo -n > expectall + : > searchall + : > expectall for ((i = 0; i < $outcount; i++)); do if ! cmp -s search.$i expected; then # Find the range of interruptions that match this output -- 2.34.1