我在 Org-Babel 中有一个小代码块,它应该取决于一些参数。我已经在 awk 中编写了代码,但我没有成功使用代码中的参数。
一个小(不工作)的例子:
#+begin_src awk :var test="value" :results output
BEGIN { print "Test is "test }
#+end_src
我的参数叫做 test,它的值是……值。结果如下:
#+results:
: Test is
变量 test 似乎没有被定义,尽管:var test="value"
但是,当尝试 awk 以外的其他语言(例如 sh 的 python)时,似乎没问题:
#+begin_src python :var test="value" :results output
print "Test is %s"%test
#+end_src
#+results:
: Test is value
#+begin_src sh :var test="value" :results output
echo "Test is "$test
#+end_src
#+results:
: Test is value
我正在使用 org 7.8.02。任何想法?谢谢!