Re: unable to escape ! in autotest stdout comparison text

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

 



On Tue, May 29, 2018 at 8:10 PM, Eric Blake <eblake@xxxxxxxxxx> wrote:

> On 05/29/2018 08:25 PM, John Calcote wrote:
>
>> I'm trying to create a test using autotest that compares the stdout of my
>> program with a string. Unfortunately, the output of the program contains
>> the path of the program. As part of its output, it writes its own program
>> name (from argv[0]) to stdout, so I have to use ${abs_top_builddir} as
>> part
>> of the comparison text - which means I need to use AT_CHECK_UNQUOTED.
>>
>>
> Yeah, bash's handling of ! can be quite a misfeature when you don't want
> it to happen during scripting.  But I thought it was disabled by default in
> POSIX mode, which is what autotest scripts should be selecting, so are you
> sure that history expansion is happening?

...

>
> First, are you sure you don't want a trailing newline?  That is, did
> src/prog output "!" as it's last character, or "\n" after the "!"?  (The
> placement of the ] in AT_CHECK[_UNQUOTED] matters).
>
> I did not realize autotest was using POSIX mode - that makes it a little
harder to explain. All I know for sure is that the output in testsuite.log
showed an empty string for the comparison text when I don't use a newline
after the bang. On the other hand, when I do use a newline after the bang,
as you suggested, it works perfectly. I always think I'll look so smart by
figuring it out and explaining the situation in posts like this, then I
find that my original assumption was nowhere near the truth. :)

More research is in order.

Thanks Eric.
_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
https://lists.gnu.org/mailman/listinfo/autoconf



[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux