From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg Troxel Subject: Re: [babel] how to pass data to gnuplot from another block Date: Fri, 13 Dec 2013 10:48:40 -0500 Message-ID: References: <87d2lsbvy7.fsf@ucl.ac.uk> <87iovkihe6.fsf@gmail.com> <8738mol52h.fsf@alphaville.bos.redhat.com> <874n73gk70.fsf@gmail.com> <87vbysahv0.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54400) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VrUys-0002cF-OH for emacs-orgmode@gnu.org; Fri, 13 Dec 2013 10:48:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VrUyn-0006GT-4o for emacs-orgmode@gnu.org; Fri, 13 Dec 2013 10:48:46 -0500 Received: from fnord.ir.bbn.com ([192.1.100.210]:63487) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VrUym-0006GJ-W7 for emacs-orgmode@gnu.org; Fri, 13 Dec 2013 10:48:41 -0500 In-Reply-To: <87vbysahv0.fsf@gmail.com> (Eric Schulte's message of "Fri, 13 Dec 2013 08:30:27 -0700") 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: Eric Schulte Cc: Nick Dokos , emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Eric Schulte writes: > Greg Troxel writes: > >> Eric Schulte writes: >> >>>> Just an fyi: I had to set org-babel-sh-command to "bash" for this to >>>> work. Why is "sh" the default value of this variable? >>> >>> I think sh is more portable, but I guess almost any system should have >>> bash as well, I've just changed this default to bash. >> >> (Assuming you mean that you changed the default in the org sources, not >> in your config files.) >> >> Please don't, at least without discussion of the consequences of adding >> a dependency that is beyond POSIX.. sh is specified by posix, and bash >> is a) sometimes not present and b) behaves differently than as specified >> by POSIX, leading people to write nonportable code. >> >> If someone wants to run bash explicitly, it makes sense to have a bash >> language block that they can use. But the sh language block should be >> sh. The real point is that bash is a different language. > > I understand your point, but in reality I doubt there are many systems > on which people use Org-mode with code blocks and on which sh is > available but no bash is installed. That may be true on some flavors of Linux, but on BSDs: bash is not the normal shell (and is not part of the base system, at least on NetBSD, and I think that's still true on the others). When it does exist it's not in /bin. =20=20 It's not so odd to have a system without bash. I am also under the impression that Debian does not use bash as the /bin/sh. org, like anything else, should be OS-agnostic, and follow open standards whenever that's at all reasonable. > Bash is the new normal shell and I would argue is what most users expect > from a shell code block. I find that pretty astounding. In a block labeled sh it is obvious that a shell conforming to the POSIX sh standard is expected, and it's not so different from a file with "#!/bin/sh". Users who expect bash in a block labeled sh are wrong, although I agree that many people have been misled this way by the culture of using "test =3D=3D" in a file that starts #!/bin/sh. The real issue is that org files that actually expect bash (test =3D=3D, etc.) become nonportable to other environments. If someone is writing a script and not intending to use beyond-posix features, it's harmful to let them work (in cases where they are published). > E.g., the default value of `shell-file-name' used by M-x shell is > "/bin/bash". I just checked on my system (NetBSD 6 i386, emacs 23.4.1), and shell-file-name is documented to inherit from SHELL if present, which it does. It's /bin/sh if SHELL is unset, which complies with the documentation: *File name to load inferior shells from. Initialized from the SHELL environment variable, or to a system-dependent default if SHELL is not set. which doesn't promise bash (or even a Bourne-style shell!). (The emacs package doesn't depend on the bash package.) But shell-file-name is about giving the user of emacs their shell, not using a particular programming language, so this fuzz is fine. > It is possible to explicitly set shell code blocks to use sh. Sure, but that wasn't my point; it's the encouragement of nonportability that is problematic. I should point out that I'm not a bash hater --- I actually use it as my interactive shell, and have done so since around 1990. But I don't write scripts in it. Greg --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (NetBSD) iEYEARECAAYFAlKrLFgACgkQ+vesoDJhHiX0MACfSPlaXr3R1LN1lrOxdBSw2V2A 6z8AmwUCGN9r179m93j54X7Yasad9T/3 =/Oz6 -----END PGP SIGNATURE----- --=-=-=--