removed use of 'echo -n' (and echo -n -e ...)

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.
This commit is contained in:
Tomi Ollila 2022-02-21 00:30:45 +02:00 committed by David Bremner
parent 999706c4d5
commit 08da7f25e5
5 changed files with 16 additions and 17 deletions

View file

@ -120,8 +120,7 @@ release-message:
@echo "Which can be verified with:" @echo "Which can be verified with:"
@echo "" @echo ""
@echo " $(RELEASE_URL)/$(SHA256_FILE)" @echo " $(RELEASE_URL)/$(SHA256_FILE)"
@echo -n " " @sed "s/^/ /" releases/$(SHA256_FILE)
@cat releases/$(SHA256_FILE)
@echo "" @echo ""
@echo " $(RELEASE_URL)/$(DETACHED_SIG_FILE)" @echo " $(RELEASE_URL)/$(DETACHED_SIG_FILE)"
@echo " (signed by `getent passwd "$$USER" | cut -d: -f 5 | cut -d, -f 1`)" @echo " (signed by `getent passwd "$$USER" | cut -d: -f 5 | cut -d, -f 1`)"
@ -169,7 +168,7 @@ release-checks:
.PHONY: verify-newer .PHONY: verify-newer
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) ; \ @wget -q --no-check-certificate -O /dev/null $(RELEASE_URL)/$(TAR_FILE) ; \
case $$? in \ case $$? in \
8) echo "Good." ;; \ 8) echo "Good." ;; \

View file

@ -59,7 +59,7 @@ readonly VERSION
# In the rest of this file, tests collect list of errors to be fixed # 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` git_status=`git status --porcelain`
if [ "$git_status" = '' ] if [ "$git_status" = '' ]
then then
@ -77,7 +77,7 @@ verfail ()
append_emsg " Please follow the instructions in RELEASING to choose a version" 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 case $VERSION in
*[!0-9.]*) *[!0-9.]*)
verfail "'$VERSION' contains other characters than digits and periods" ;; verfail "'$VERSION' contains other characters than digits and periods" ;;
@ -88,7 +88,7 @@ case $VERSION in
*) verfail "'$VERSION' is a single number" ;; *) verfail "'$VERSION' is a single number" ;;
esac 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 read deb_notmuch deb_version rest < debian/changelog
if [ "$deb_notmuch" = 'notmuch' ] if [ "$deb_notmuch" = 'notmuch' ]
then then
@ -98,7 +98,7 @@ else
append_emsg "Package name '$deb_notmuch' is not 'notmuch' in debian/changelog" append_emsg "Package name '$deb_notmuch' is not 'notmuch' in debian/changelog"
fi 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)" ] if [ "$deb_version" = "($VERSION-1)" ]
then then
@ -108,7 +108,7 @@ else
append_emsg "Version '$deb_version' is not '($VERSION-1)' in debian/changelog" append_emsg "Version '$deb_version' is not '($VERSION-1)' in debian/changelog"
fi 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__)"` py_version=`python3 -c "with open('$PV_FILE') as vf: exec(vf.read()); print(__VERSION__)"`
if [ "$py_version" = "$VERSION" ] if [ "$py_version" = "$VERSION" ]
then then
@ -118,7 +118,7 @@ else
append_emsg "Version '$py_version' is not '$VERSION' in $PV_FILE" append_emsg "Version '$py_version' is not '$VERSION' in $PV_FILE"
fi 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`" ] if [ "`exec sed 's/./=/g; 1q' NEWS`" = "`exec sed '1d; 2q' NEWS`" ]
then then
echo Yes. echo Yes.
@ -132,7 +132,7 @@ else
fi fi
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 read news_notmuch news_version news_date < NEWS
if [ "$news_notmuch" = "Notmuch" ] if [ "$news_notmuch" = "Notmuch" ]
then then
@ -142,7 +142,7 @@ else
append_emsg "First word '$news_notmuch' is not 'Notmuch' in NEWS file" append_emsg "First word '$news_notmuch' is not 'Notmuch' in NEWS file"
fi fi
echo -n "Checking that NEWS version is $VERSION... " printf %s "Checking that NEWS version is $VERSION... "
if [ "$news_version" = "$VERSION" ] if [ "$news_version" = "$VERSION" ]
then then
echo Yes. echo Yes.
@ -154,7 +154,7 @@ fi
#eval `date '+year=%Y mon=%m day=%d'` #eval `date '+year=%Y mon=%m day=%d'`
today0utc=`date --date=0Z +%s` # gnu date feature 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 case $news_date in
'('[2-9][0-9][0-9][0-9]-[01][0-9]-[0123][0-9]')') '('[2-9][0-9][0-9][0-9]-[01][0-9]-[0123][0-9]')')
newsdate0utc=`nd=${news_date#\\(}; date --date="${nd%)} 0Z" +%s` newsdate0utc=`nd=${news_date#\\(}; date --date="${nd%)} 0Z" +%s`
@ -176,7 +176,7 @@ case $news_date in
esac esac
year=`exec date +%Y` 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'. # Read the value of variable `copyright' defined in 'doc/conf.py'.
copyrightline=$(grep ^copyright doc/conf.py) copyrightline=$(grep ^copyright doc/conf.py)
case $copyrightline in case $copyrightline in

View file

@ -435,7 +435,7 @@ test_expect_equal_file EXPECTED OUTPUT
test_begin_subtest "search for non-existent message prints nothing" test_begin_subtest "search for non-existent message prints nothing"
notmuch search "no-message-matches-this" > OUTPUT notmuch search "no-message-matches-this" > OUTPUT
echo -n >EXPECTED : >EXPECTED
test_expect_equal_file EXPECTED OUTPUT test_expect_equal_file EXPECTED OUTPUT
test_begin_subtest "search --format=json for non-existent message prints proper empty json" test_begin_subtest "search --format=json for non-existent message prints proper empty json"

View file

@ -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" 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 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 test_expect_equal_file crlf.out crlf.expected

View file

@ -71,8 +71,8 @@ if test_require_external_prereq gdb; then
# Check output against golden output # Check output against golden output
outcount=$(cat outcount) outcount=$(cat outcount)
echo -n > searchall : > searchall
echo -n > expectall : > expectall
for ((i = 0; i < $outcount; i++)); do for ((i = 0; i < $outcount; i++)); do
if ! cmp -s search.$i expected; then if ! cmp -s search.$i expected; then
# Find the range of interruptions that match this output # Find the range of interruptions that match this output