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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

> Junio C Hamano wrote:
..
>> 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.
>> 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).

Thank you very much for sharing this information. It was really really
informative.
Thanks to Ángel González and Victor Engmark for sharing their views.

Considering all the suggestions, I think, it is "not possible to
satisfy everyone" :)
So, I have modified the patch by incorporating most of the nice suggestions.

Please let me know your comments.

Signed-off-by: Maxin B. John <maxin@xxxxxxxxxxxxxxx>
---
diff --git a/contrib/thunderbird-patch-inline/appp.sh
b/contrib/thunderbird-patch-inline/appp.sh
index cc518f3..20dac9f 100755
--- a/contrib/thunderbird-patch-inline/appp.sh
+++ b/contrib/thunderbird-patch-inline/appp.sh
@@ -1,8 +1,8 @@
-#!/bin/bash
+#!/bin/sh
 # Copyright 2008 Lukas Sandström <luksan@xxxxxxxxx>
 #
 # AppendPatch - A script to be used together with ExternalEditor
-# for Mozilla Thunderbird to properly include pathes inline i e-mails.
+# for Mozilla Thunderbird to properly include patches inline in e-mails.

 # ExternalEditor can be downloaded at http://globs.org/articles.php?lng=en&pg=2

@@ -16,13 +16,12 @@ else
        cd > /dev/null
 fi

-PATCH=$(zenity --file-selection)
-
-if [ "$?" != "0" ] ; then
-       #zenity --error --text "No patchfile given."
-       exit 1
+#check whether zenity is present
+if ! type zenity >/dev/null 2>&1 ; then
+       exit 1
 fi

+PATCH=$(zenity --file-selection) || exit 1
 cd - > /dev/null

 SUBJECT=`sed -n -e '/^Subject: /p' "${PATCH}"`
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]