bug-patch
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-patch] patch 2.7.1 tests fail when $(SHELL) is not bash or bash


From: Mike Frysinger
Subject: Re: [bug-patch] patch 2.7.1 tests fail when $(SHELL) is not bash or bash-like
Date: Tue, 13 Nov 2012 15:09:57 -0500
User-agent: KMail/1.13.7 (Linux/3.6.5; KDE/4.6.5; x86_64; ; )

On Tuesday 13 November 2012 13:17:40 Harald van Dijk wrote:
> Secondly, echo -e is nonportable (see `man 1p echo` on most Linux
> systems), and doesn't behave on dash as it does on bash, causing a test
> failure in crlf-handling.
> 
> --- patch-2.7.1/tests/crlf-handling
> +++ patch-2.7.1/tests/crlf-handling
> @@ -14,7 +14,7 @@
>  use_tmpdir
> 
>  lf2crlf() {
> -    while read l; do echo -e "$l\r"; done
> +    while read l; do printf "%s\r\n" "$l"; done
>  }
> 
>  echo 1 > a
> 
> printf is valid POSIX sh, which is what I've replaced it with, but I
> don't know how portable it is to not-quite-POSIX shells that you may
> wish to support.

i don't think those statements are equivalent.  you probably want to use %b 
instead of %s.

printf should be portable to any semi-relevant system (and more).
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]