git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 1/1] check-non-portable-shell.pl: Quoted `wc -l` is not portable

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Dec 17, 2017, 00:06 UTC
Message-ID
<CAPig+cQtcNhz3Z+iZRWx1PjnJwWeeo19gUNQRHOcJyxEgfUDsQ@mail.gmail.com>
In-Reply-To
<20171216195246.10445-1-tboegi@web.de>
On Sat, Dec 16, 2017 at 2:52 PM,  <tboegi@web.de> wrote:
Show 16 quoted lines
> [...]
> Add a check in check-non-portable-shell.pl to find '"' between
> `wc -l` and '=' and hint the user about test_line_count().
>
> Reviewed-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
> Signed-off-by: Torsten Bögershausen <tboegi@web.de>
> ---
> diff --git a/t/check-non-portable-shell.pl b/t/check-non-portable-shell.pl
> index 03dc9d2852..fadbb1e5a7 100755
> --- a/t/check-non-portable-shell.pl
> +++ b/t/check-non-portable-shell.pl
> @@ -21,6 +21,7 @@ while (<>) {
>         /^\s*declare\s+/ and err 'arrays/declare not portable';
>         /^\s*[^#]\s*which\s/ and err 'which is not portable (please use type)';
>         /\btest\s+[^=]*==/ and err '"test a == b" is not portable (please use =)';
> +       /\bwc -l.*"\s*=/ and err '`"$(wc -l)"` is not portable, please use test_line_count';
Nit: Every other "please use" suggestion is parenthesized; for
consistency, this probably ought to be, as well.
>         /\bexport\s+[A-Za-z0-9_]*=/ and err '"export FOO=bar" is not portable (please use FOO=bar && export FOO)';
Previous: tboegi@web.deNext: tboegi@web.de
Message 20 of 26 in “What's cooking in git.git (Dec 2017, #01; Mon, 4)”
  1. Junio C HamanoDec 4, 2017
  2. Jeff HostetlerDec 4, 2017
  3. Elijah NewrenDec 4, 2017
  4. Jonathan TanDec 4, 2017
  5. Junio C HamanoDec 5, 2017
  6. Lars SchneiderDec 6, 2017
  7. Torsten BögershausenDec 6, 2017
  8. Junio C HamanoDec 6, 2017
  9. Johannes SchindelinDec 7, 2017
  10. Todd ZullingerDec 7, 2017
  11. Junio C HamanoDec 7, 2017
  12. Lars SchneiderDec 7, 2017
  13. Junio C HamanoDec 7, 2017
  14. Jeff HostetlerDec 7, 2017
  15. Junio C HamanoDec 7, 2017
  16. 1/1 check-non-portable-shell.pl: Quoted `wc -l` is not portabletboegi@web.de, Dec 10, 2017
  17. Johannes SchindelinDec 10, 2017
  18. Junio C HamanoDec 11, 2017
  19. 1/1 check-non-portable-shell.pl: Quoted `wc -l` is not portabletboegi@web.de, Dec 16, 2017
  20. Eric SunshineDec 17, 2017
  21. 1/1 check-non-portable-shell.pl: Quoted `wc -l` is not portabletboegi@web.de, Dec 21, 2017
  22. Junio C HamanoDec 22, 2017
  23. Torsten BögershausenDec 23, 2017
  24. Todd ZullingerDec 7, 2017
  25. Torsten BögershausenDec 9, 2017
  26. Johannes SchindelinDec 10, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.