From mboxrd@z Thu Jan 1 00:00:00 1970 From: Achim Gratz Subject: Re: [PATCH] ob-shell Date: Sun, 25 Jan 2015 12:41:56 +0100 Message-ID: <87wq4b6q9n.fsf@Rainer.invalid> References: <86vbsycepz.fsf@somewhere.org> <87tx8iks22.fsf@bzg.ath.cx> <86ppi6qnb5.fsf@somewhere.org> <87vbrxx4zr.fsf@Rainer.invalid> <86ppi5uwgl.fsf@somewhere.org> <877g4cacn9.fsf@Rainer.invalid> <87vbrt8hpo.fsf_-_@Rainer.invalid> <87ha3ck9as.fsf@gmail.com> <87bns0gho2.fsf@Rainer.invalid> <8761hke6ff.fsf@Rainer.invalid> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55021) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YFLZx-0000Hq-H9 for emacs-orgmode@gnu.org; Sun, 25 Jan 2015 06:42:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YFLZs-0002PC-D5 for emacs-orgmode@gnu.org; Sun, 25 Jan 2015 06:42:09 -0500 Received: from plane.gmane.org ([80.91.229.3]:57897) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YFLZs-0002Op-6k for emacs-orgmode@gnu.org; Sun, 25 Jan 2015 06:42:04 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1YFLZq-0006zO-Lb for emacs-orgmode@gnu.org; Sun, 25 Jan 2015 12:42:02 +0100 Received: from p54b47e5a.dip0.t-ipconnect.de ([84.180.126.90]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 25 Jan 2015 12:42:02 +0100 Received: from Stromeko by p54b47e5a.dip0.t-ipconnect.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 25 Jan 2015 12:42:02 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Pascal Fleury writes: > Here is a patch that will figure out the version of bash in a less > fork-y way. It keeps the result in a variable after having gotten it > the first time by indeed forking to bash. I still think this should be a defcustom instead with a setter function that checks for the actual availablity of array variables. The user should have the opportunity to not use arrays at all even when the shell supports it. Using array variable syntax to get the major version number of the installled Bash might not work in those shells that don't have arrays. I can't test an old Bash, but dash doesn't recognize the syntax at all. There should be no fallback to checking just the version of bash since array variables may have been backported or disabled for the actual variant of Bash that is used. Also, the code as presented doesn't deal with the possibility that Tramp might be invoking a different shell on a remote machine, but that is a problem in more areas. Regards, Achim. -- +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+ Factory and User Sound Singles for Waldorf rackAttack: http://Synth.Stromeko.net/Downloads.html#WaldorfSounds