emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric Schulte <eric.schulte@gmx.com>
To: nicholas.dokos@hp.com
Cc: Emacs orgmode <emacs-orgmode@gnu.org>
Subject: Re: Blank first line in a tangled file prevents src block execution
Date: Fri, 09 Mar 2012 15:26:57 -0700	[thread overview]
Message-ID: <874ntxs95a.fsf@gmx.com> (raw)
In-Reply-To: <6613.1331330909@alphaville> (Nick Dokos's message of "Fri, 09 Mar 2012 17:08:29 -0500")

Nick Dokos <nicholas.dokos@hp.com> writes:

> Leo Alekseyev <dnquark@gmail.com> wrote:
>
>> 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:
>> 
>
> Add ":padline no"
>

Or try

#+begin_src sh :tangle code/get_wavs.sh :shebang #!/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

-- 
Eric Schulte
http://cs.unm.edu/~eschulte/

  reply	other threads:[~2012-03-09 22:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-09 21:57 Leo Alekseyev
2012-03-09 22:08 ` Nick Dokos
2012-03-09 22:26   ` Eric Schulte [this message]
2012-03-09 23:14     ` Nick Dokos
2012-03-12  4:40       ` Eric Schulte

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874ntxs95a.fsf@gmx.com \
    --to=eric.schulte@gmx.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=nicholas.dokos@hp.com \
    --subject='Re: Blank first line in a tangled file prevents src block execution' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).