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

Re: [PATCH] Remove "bashism" from contrib/thunderbird-patch-inline/appp.sh

From
MJMaxin john <maxin@maxinbjohn.info>
Date
Mar 29, 2011, 06:54 UTC
Message-ID
<AANLkTikaZA=7EFMVf1hwEoQJd6hChha0cCL7ZRMEZXyS@mail.gmail.com>
In-Reply-To
<4D9103D3.5010403@zoho.com>
Hi,

Thank you very much for the suggestions. However, I have tested this script in Ubuntu which uses dash as /bin/sh

Eg: the following script runs successfully in Ubuntu 10.10
#!/bin/dash
PATCH=$(zenity --file-selection)
if [ "$?" != "0" ] ; then
 echo "zenity failed"
else
 echo "success"
fi

I haven't confirmed this in other shell implementations. Please let me know your comments on this.

Best Regards, Maxin B. John

2011/3/29 Ángel González <ingenit@zoho.com>:
Show 26 quoted lines
> Maxin john wrote:
>> Remove "bashism" and minor corrections for
>> contrib/thunderbird-patch-inline/appp.sh
>>
>> Signed-off-by: Maxin B. John <maxin@maxinbjohn.info>
>
> This is wrong.
>
> You are replacing bash with sh:
>> -#!/bin/bash
>> +#!/bin/sh
>
> but the script still uses bash-specific syntax (aka. bashishms):
>> +
>>  PATCH=$(zenity --file-selection)
>>
>>  if [ "$?" != "0" ] ; then
>
> So with your change the script won't be able to run on systems which
> don't have bash as /bin/sh
>
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
Previous: Ángel GonzálezNext: Junio C Hamano
Message 3 of 13 in “Remove "bashism" from contrib/thunderbird-patch-inline/appp.sh”
  1. Remove "bashism" from contrib/thunderbird-patch-inline/appp.shMaxin john, Mar 27, 2011
  2. Ángel GonzálezMar 28, 2011
  3. Maxin johnMar 29, 2011
  4. Junio C HamanoMar 29, 2011
  5. Ángel GonzálezMar 29, 2011
  6. Maxin johnMar 30, 2011
  7. Junio C HamanoMar 30, 2011
  8. Maxin johnMar 30, 2011
  9. Junio C HamanoMar 31, 2011
  10. Ángel GonzálezMar 29, 2011
  11. Junio C HamanoMar 29, 2011
  12. Maxin johnMar 29, 2011
  13. Victor EngmarkMar 29, 2011

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.