Re: [PATCH] Get rid of the non portable shell export VAR=VALUE costruct
- From
Johannes Sixt <j.sixt@viscovery.net>
- Date
- May 22, 2014, 14:28 UTC
- Message-ID
- <537E09AA.7030901@viscovery.net>
- In-Reply-To
- <87a9aa7xxt.fsf@fencepost.gnu.org>
Am 5/22/2014 15:19, schrieb David Kastrup:
Show 22 quoted lines
> Torsten Bögershausen <tboegi@web.de> writes: > >> On 2014-05-22 14.48, Elia Pinto wrote: >>> Found by check-non-portable-shell.pl >> >> Thanks for picking this up >>> -export TEST_DIRECTORY=$(pwd)/../../../t >>> +TEST_DIRECTORY=$(pwd)/../../../t && export TEST_DIRECTORY >> Minor remark: >> Both commands should go on their own line, like this: >> >> TEST_DIRECTORY=$(pwd)/../../../t && >> export TEST_DIRECTORY >> >> >> And, unrelated to this patch, >> there seem to be a lot of && missing in git-remote-testgit.sh. > > I have a hard time taking the above && seriously. pwd is a shell > builtin (when we are not talking about Version 3 UNIX or something) that > can hardly fail. And when your shell does not support assignment to a > shell variable, you'll have a hard time getting the shell script to run.
The && after an assignment makes a big difference when the assignment is part of an && chain. This is *very* common in our test suite, as you know.
People tend to copy-and-paste. And then it is better to provide a more universally applicable precedent.
-- Hannes