From mboxrd@z Thu Jan 1 00:00:00 1970 From: Leo Alekseyev Subject: Blank first line in a tangled file prevents src block execution Date: Fri, 9 Mar 2012 16:57:10 -0500 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:50596) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S67oT-00050z-BE for emacs-orgmode@gnu.org; Fri, 09 Mar 2012 16:57:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S67oI-00028Q-Ed for emacs-orgmode@gnu.org; Fri, 09 Mar 2012 16:57:24 -0500 Received: from mail-pz0-f41.google.com ([209.85.210.41]:45146) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S67oI-00027X-6C for emacs-orgmode@gnu.org; Fri, 09 Mar 2012 16:57:14 -0500 Received: by dadv6 with SMTP id v6so2027279dad.0 for ; Fri, 09 Mar 2012 13:57:11 -0800 (PST) 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 I have the following source block that I tangle to produce a short script: #+begin_src sh :tangle code/get_wavs.sh #!/bin/bash for fn_in in "$@"; do fn_out=$(sed -e 's|\.3gp$||g' -e 's|$|.wav|g' <<< $fn_in) ffmpeg -i $fn_in -vn -f wav -acodec pcm_u8 $fn_out done #+end_src However, the tangled file has a blank first line. As a result, I can't seem to run this script either using sh -c, or by putting it inside a code block. In other words, the following line fails: sh -c "code/test.sh data/salsa/20120308_av_jc/song2/*.3gp" code/test.sh: 4: Syntax error: redirection unexpected And, similarly, this fails #+begin_src sh code/get_wavs.sh data/salsa/20120308_av_jc/song2/*.3gp #+end_src On the other hand, the script runs fine from the command line, or from an org-mode shell: link, i.e. just running code/test.sh data/salsa/20120308_av_jc/song2/*.3gp at bash prompt produces the desired result. I am not sure what the rules are about blank lines before the hash-bang directive in Bash, and why in particular the blank line seems to cause sh -c ... and orb-babel src execution to break, but the current behavior seems broken.