diff mbox series

[iptables,6/7] build: replace `echo -e` with `printf`

Message ID 20231214125927.925993-7-jeremy@azazel.net
State Changes Requested
Headers show
Series Autoools silent-rules fixes | expand

Commit Message

Jeremy Sowden Dec. 14, 2023, 12:59 p.m. UTC
`echo -e` is not portable and we can end up with:

      GEN      matches.man
    -e      + ./libxt_addrtype.man
    -e      + ./libip6t_ah.man
    -e      + ./libipt_ah.man
    -e      + ./libxt_bpf.man
    -e      + ./libxt_cgroup.man
    -e      + ./libxt_cluster.man
    -e      + ./libxt_comment.man
    -e      + ./libxt_connbytes.man
    -e      + ./libxt_connlabel.man
    -e      + ./libxt_connlimit.man
    -e      + ./libxt_connmark.man
    -e      + ./libxt_conntrack.man
    [...]

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
 extensions/GNUmakefile.in | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Jeremy Sowden Dec. 14, 2023, 2:44 p.m. UTC | #1
On 2023-12-14, at 12:59:21 +0000, Jeremy Sowden wrote:
> `echo -e` is not portable and we can end up with:
> 
>       GEN      matches.man
>     -e      + ./libxt_addrtype.man
>     -e      + ./libip6t_ah.man
>     -e      + ./libipt_ah.man
>     -e      + ./libxt_bpf.man
>     -e      + ./libxt_cgroup.man
>     -e      + ./libxt_cluster.man
>     -e      + ./libxt_comment.man
>     -e      + ./libxt_connbytes.man
>     -e      + ./libxt_connlabel.man
>     -e      + ./libxt_connlimit.man
>     -e      + ./libxt_connmark.man
>     -e      + ./libxt_conntrack.man
>     [...]
> 
> Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
> ---
>  extensions/GNUmakefile.in | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/extensions/GNUmakefile.in b/extensions/GNUmakefile.in
> index dfa58c3b9e8b..f41af7c1420d 100644
> --- a/extensions/GNUmakefile.in
> +++ b/extensions/GNUmakefile.in
> @@ -228,19 +228,19 @@ man_run    = \
>  	for ext in $(sort ${1}); do \
>  		f="${srcdir}/libxt_$$ext.man"; \
>  		if [ -f "$$f" ]; then \
> -			echo -e "\t+ $$f" >&2; \
> +			printf "\t+ $$f" >&2; \
>  			echo ".SS $$ext"; \
>  			cat "$$f" || exit $$?; \
>  		fi; \
>  		f="${srcdir}/libip6t_$$ext.man"; \
>  		if [ -f "$$f" ]; then \
> -			echo -e "\t+ $$f" >&2; \
> +			printf "\t+ $$f" >&2; \
>  			echo ".SS $$ext (IPv6-specific)"; \
>  			cat "$$f" || exit $$?; \
>  		fi; \
>  		f="${srcdir}/libipt_$$ext.man"; \
>  		if [ -f "$$f" ]; then \
> -			echo -e "\t+ $$f" >&2; \
> +			printf "\t+ $$f" >&2; \
>  			echo ".SS $$ext (IPv4-specific)"; \
>  			cat "$$f" || exit $$?; \
>  		fi; \
> -- 
> 2.43.0
> 
> 

Just noticed that there should be newlines in the printf commands.  Will
resend.

J.
diff mbox series

Patch

diff --git a/extensions/GNUmakefile.in b/extensions/GNUmakefile.in
index dfa58c3b9e8b..f41af7c1420d 100644
--- a/extensions/GNUmakefile.in
+++ b/extensions/GNUmakefile.in
@@ -228,19 +228,19 @@  man_run    = \
 	for ext in $(sort ${1}); do \
 		f="${srcdir}/libxt_$$ext.man"; \
 		if [ -f "$$f" ]; then \
-			echo -e "\t+ $$f" >&2; \
+			printf "\t+ $$f" >&2; \
 			echo ".SS $$ext"; \
 			cat "$$f" || exit $$?; \
 		fi; \
 		f="${srcdir}/libip6t_$$ext.man"; \
 		if [ -f "$$f" ]; then \
-			echo -e "\t+ $$f" >&2; \
+			printf "\t+ $$f" >&2; \
 			echo ".SS $$ext (IPv6-specific)"; \
 			cat "$$f" || exit $$?; \
 		fi; \
 		f="${srcdir}/libipt_$$ext.man"; \
 		if [ -f "$$f" ]; then \
-			echo -e "\t+ $$f" >&2; \
+			printf "\t+ $$f" >&2; \
 			echo ".SS $$ext (IPv4-specific)"; \
 			cat "$$f" || exit $$?; \
 		fi; \