[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[O] ob-shell: using a table variable with bash
From: |
George Kettleborough (EI) |
Subject: |
[O] ob-shell: using a table variable with bash |
Date: |
Fri, 3 Mar 2017 12:40:54 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 |
Hello,
I recently updated my org-mode from version 7 (I think) to the latest.
The behaviour of using a table as a variable in a shell code source
block has changed. I use to use it like this:
#+BEGIN_SRC sh :results output :var table=synteny-names :separator ,
IFS=','
while read col1 col2; do
# do stuff
done <<EOF
$table
EOF
#+END_SRC
This just stopped working with the new version and I could not figure
out why for a long time. But I looked in the new ob-shell.el code and
figured out that when the shell is bash it now makes an associative
array if the variable is a table. I couldn't seem to find this
documented anywhere.
This new behaviour seems like it would be useful in a lot of cases, but
in my case, the tables are not key-value pairs, they are merely things I
want to iterate over. I wonder if simply checking to see if :separator
is set and using the old behaviour if so would be better? This would
seem to be a fine fix which maintains backwards compatibility unless
there is a reason to set :separator but still expect the new behaviour.
Thanks,
George.
ob-shell.patch
Description: Text Data
- [O] ob-shell: using a table variable with bash,
George Kettleborough (EI) <=