Re: [PATCH] Remove "bashism" from contrib/thunderbird-patch-inline/appp.sh
- From
- Ángel González <ingenit@zoho.com>
- Date
- Mar 29, 2011, 22:48 UTC
- Message-ID
- <4D9261AE.5070103@zoho.com>
- In-Reply-To
- <7vei5qtnc5.fsf@alter.siamese.dyndns.org>
Junio C Hamano wrote:
Show 13 quoted lines
> Ángel González <ingenit@zoho.com> writes: > >> This is wrong. > > Not really. > >> You are replacing bash with sh: >>> -#!/bin/bash >>> +#!/bin/sh >> >> but the script still uses bash-specific syntax (aka. bashishms): > > Do you mean some of the parts you quoted are bashism?
I was pointing to the $( ) as a bashishm
Show 7 quoted lines
>>> PATCH=$(zenity --file-selection) > > Even though ancient shells I grew up with did not have $(), it is a way > backticks should have been written by Bourne from day one. Historically, > handling nesting and interraction between double-quotes and backticks > correctly was a nightmare to get right, and different implementations of > shells got them always wrong. If you use $(), the headaches go away.
Show 7 quoted lines
> These days, we don't know of any POSIX shell that is widely used and does > not understand $(). As such, the above construct is perfectly safe and > even preferred over ``. Welcome to the 21st century ;-) > > The only major platform that didn't have a reasonable shell was Solaris, > but we already have written its /bin/sh off as broken and unusable, and > suggest people to use xpg4 or xpg6 shell (see the Makefile).
I have to agree with you. $() is a much saner syntax. Still, the goal was portability. Reading your message, and considering the Solaris note, it might have been fine as it was. I have also checked the "Shell Command Language" section of IEEE Std 1003.1 and it does require $() use.
Albeit being a single line I would still change it, it is now a much weaker position. Thanks for your insight.