From d7ae66f869e50066dd7dd4297e175b744535cb32 Mon Sep 17 00:00:00 2001 From: Jakub Jirutka Date: Sat, 5 Nov 2022 18:25:04 +0100 Subject: replace 'echo -n' and 'echo -e' with printf 'echo -n' and 'echo -e' are not portable, not all commonly used shells support both of them (in the same way). 'echo -e' is not even defined in POSIX. https://pubs.opengroup.org/onlinepubs/009604599/utilities/echo.html: > New applications are encouraged to use printf instead of echo. > ... > Conforming applications that wish to do prompting without s > or that could possibly be expecting to echo a -n, should use the > printf utility derived from the Ninth Edition system. --- setup-mta.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setup-mta.in') diff --git a/setup-mta.in b/setup-mta.in index eaea499..3758d5c 100644 --- a/setup-mta.in +++ b/setup-mta.in @@ -64,7 +64,7 @@ while [ $# -eq 0 ] && [ "$res" != "221" ]; do if ! ask_yesno "Test connection? (y/n)" y; then break fi - res=$(echo -e "quit\r\n" | nc $mailhub 25 | awk '/^221/ {print $1}') + res=$(printf "quit\r\n\n" | nc $mailhub 25 | awk '/^221/ {print $1}') [ "x$res" = "x221" ] && echo "Connection to $mailhub is ok." done -- cgit v1.2.3