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 13:38:57 -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> <87ob4kafjd.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]:43610) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VrXdf-0003FM-SR for emacs-orgmode@gnu.org; Fri, 13 Dec 2013 13:39:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VrXdZ-0002BN-T4 for emacs-orgmode@gnu.org; Fri, 13 Dec 2013 13:39:03 -0500 Received: from fnord.ir.bbn.com ([192.1.100.210]:63054) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VrXdZ-0002BH-Mq for emacs-orgmode@gnu.org; Fri, 13 Dec 2013 13:38:57 -0500 In-Reply-To: <87ob4kafjd.fsf@gmail.com> (Eric Schulte's message of "Fri, 13 Dec 2013 09:20:38 -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 Eric Schulte writes: > Although purely semantically, in my opinion the "sh" in "#+begin_src sh" > indicates generic "shell-script", not the POSIX sh. E.g., there is no > ob-bash.el or ob-csh.el. I see your point. But stepping back, I have always felt that "#+begin_src foo" referred to a language, sometimes where that language and a particular program are inseparable (e.g. gnuplot). But sh is a first-class language. > See the first line in ob-sh.el, > ,---- > | ;;; ob-sh.el --- org-babel functions for shell evaluation > `---- Sure, but that's just repeated the ambiguity :-) > And this is where we disagree. Sh code blocks don't currently promise > POSIX sh, they promise a shell. This is certainly a much more dangerous > generalization than say Perl code blocks possibly using Perl 5 or 6. For shell, I see that there are two concepts to detangle: a shell is a particular command interpreter, particularly useful for humans there are multiple shell languages, but far fewer than the number of interpreters. For languages, I see POSIX sh the bash flavor of POSIX sh csh While bash and POSIX sh are close, csh isn't at all close, and is only similar in that people also use it for a shell. In an org document, I think it's better if the result depends less on variables not set in the document. So a code block in a document is really written in some language. And it therefore makes sense to specify that in the begin_src wrapper. I don't see that there is any call for csh, as the received wisdom is that one shouldn't write scripts in it (at least in modern times). (It was originally a BSD thing, and BSD culture is very much POSIX sh now.) So separately from how the lisp works, I would favor #+begin_src sh # posix sh #+begin_src bash # bash (leaving version ambiguous??) #+begin_src csh # csh, but not sure there's a need > How about the following resolution? We rename ob-sh.el to ob-shell.el. > New "shell" code blocks could use the value of the > `org-babel-sh-command' environment variable. Then sh, bash, zsh, csh, > ash, dash (am I missing any other common ones) use the specific shell > specified. Are you aware of any significant use of "zsh scripts"? I see that as POSIX sh, with spiffy user-facing features. > In the mean time, I don't believe the change in default value for > `org-babel-sh-command' has been included in any maintenance releases, so > I've just reverted this to minimize any further confusion. Thanks. It's good to be having the larger discussion first. > And I should say that I've argued the same point your making myself in > the past (on a project making the much more serious error of using bash > notation ">&" in a shell script starting with "#!/bin/sh"). I think we > only disagree on the current meaning of "sh" in code blocks, which > hopefully the suggestion above will rectify. I forgot about "&>", even though I type it all the time interactively but I'm pretty careful in scripts :-) Thanks, Greg --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (NetBSD) iEYEARECAAYFAlKrVEEACgkQ+vesoDJhHiUlMwCgr6qer1IUGujYcxuSjLENyHDy y0YAn3asskNyvqS9OoStHUT3359DJGrj =aXv6 -----END PGP SIGNATURE----- --=-=-=--