diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2022-11-05 18:25:04 +0100 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2022-11-05 21:31:46 +0000 |
commit | d7ae66f869e50066dd7dd4297e175b744535cb32 (patch) | |
tree | 687d70bc8e0138e7d7195bc42787c2714edf4758 /setup-mta.in | |
parent | f2a081f99a927faa9f7e21f7b25aa55af985fda0 (diff) | |
download | alpine-conf-d7ae66f869e50066dd7dd4297e175b744535cb32.zip |
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 <newline>s
> or that could possibly be expecting to echo a -n, should use the
> printf utility derived from the Ninth Edition system.
Diffstat (limited to 'setup-mta.in')
-rw-r--r-- | setup-mta.in | 2 |
1 files changed, 1 insertions, 1 deletions
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 |