From: Junio C Hamano Date: Wed, 13 May 2015 14:01:22 GMT Subject: Re: [PATCH v3 1/9] t5520: fixup file contents comparisons Message-ID: In-Reply-To: <1431508136-15313-2-git-send-email-pyokagan@gmail.com> Paul Tan writes: > 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?