[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: patch for problems with echo '-...' and echo '...\...'
From: |
Paul Eggert |
Subject: |
Re: patch for problems with echo '-...' and echo '...\...' |
Date: |
Sat, 18 Nov 2006 17:19:14 -0800 |
User-agent: |
Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux) |
Paul Eggert <address@hidden> writes:
> I fixed the problems that Ralf spotted in my pre-2.61 proposal (at
> least, the problems I understood... :-) and installed this patch.
To test that patch, I tried CVS autoconf on Solaris 8 with
CONFIG_SHELL=/bin/sh, on an older 400 MHz Sparc host. Talk about
slow!
The tests eventually passed, but I found some other occurrences of
'echo' that I had missed, so I installed the following further patch.
These instances affect only Autoconf's test cases, not the code
proper, so I thought it'd be better to simply use printf '%s\n' rather
than echo here. As far as I know all users of Autoconf itself (as
opposed to the scripts 'configure' generate) have the printf command.
If I'm wrong, the worst that can happen is that we'll get some bug
reports of tests failing even though Autoconf itself is OK.
2006-11-18 Paul Eggert <address@hidden>
* tests/autotest.at (BSx641-newline in command):
(BS-BS-newline in command, BSx640-newline in command):
(Newline-CODE-BS-newline in command):
(Single-quote-BS-newline in command):
(Single-quote-newline-BS-newline in command):
Use printf '%s\n' instead of echo, for portability to hosts
where echo interprets backslashes. This will break on hosts
that lack printf, but for now let's assume all such hosts
are dead (if not, we should get reports of test failures).
--- tests/autotest.at 17 Nov 2006 09:17:38 -0000 1.20
+++ tests/autotest.at 19 Nov 2006 01:10:34 -0000
@@ -191,12 +191,12 @@ echo GNU], 0, [GNU
], [])])
AT_CHECK_AT_TEST([BSx641-newline in command],
- [AT_CHECK([echo
Auto"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\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\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
"conf], 0,
[Auto\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\conf
], [])])
AT_CHECK_AT_TEST([BS-BS-newline in command],
- [AT_CHECK([echo Auto"\\
+ [AT_CHECK([printf '%s\n' Auto"\\
"conf], 0, [Auto\
conf
], [])])
@@ -204,27 +204,27 @@ conf
# A `^BS-BS-newline in command' test will run a command named `\'. No, thanks.
AT_CHECK_AT_TEST([BSx640-newline in command],
- [AT_CHECK([echo
Auto"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\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\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
conf
], [])])
# This command has both escaped and unescaped newlines.
AT_CHECK_AT_TEST([Newline-CODE-BS-newline in command],
- [AT_CHECK([echo Auto'
+ [AT_CHECK([printf '%s\n' Auto'
'co\
nf], 0, [Auto
conf
], [])])
AT_CHECK_AT_TEST([Single-quote-BS-newline in command],
- [AT_CHECK([echo Auto'\
+ [AT_CHECK([printf '%s\n' Auto'\
'conf], 0, [Auto\
conf
], [])])
AT_CHECK_AT_TEST([Single-quote-newline-BS-newline in command],
- [AT_CHECK([echo Auto'
+ [AT_CHECK([printf '%s\n' Auto'
\
'conf], 0, [Auto
\