Re: [PATCH v3 1/9] t5520: fixup file contents comparisons
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 13, 2015, 14:01 UTC
- Message-ID
- <xmqqk2wcbmq5.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <1431508136-15313-2-git-send-email-pyokagan@gmail.com>
Paul Tan <pyokagan@gmail.com> writes:
Show 15 quoted lines
> Many tests in t5520 used the following to test the contents of files: > > test `cat file` = expected > > or > > test $(cat file) = expected > > These 2 forms, however, will be affected by field splitting and, > depending on the value of $IFS, may be split into multiple arguments, > making the test fail in mysterious ways. > > Replace the above 2 forms with: > > verbose test "$(cat file)" = expected
Quoting is very much a good idea, but I am not enthused by the vision of having to write verbose everywhere in our script.
After seeing a script fail, you can run it again with -i -x options; wouldn't it be sufficient?