Samuel Wales <samolog...@gmail.com> writes: > hi eric, > > the object is to make the code inside a babel shell block as similar > to a real shell script as possible. also, calling it using #+call > should be like calling it from another shell script. > > this isn't possible in babel at present. > > the script cannot use "$@" for its positional parameters. it could > use <<noweb>>, but that requires the creation of an extraneous block > merely to do a call, instead of supplying the value in the call line. >
A couple of languages already support a :cmdline header argument. I've just added shell block support for :cmdline, so the following is now possible. #+begin_src sh :cmdline "foo bar baz" echo $2 #+end_src #+RESULTS: : bar > > if making this possible is not desirable, then i will not request it, > but i wanted to explain why this object is not achieved with existing > babel options that i am aware of. > I hope the above is sufficient, if not I'm not personally able to do much more on this front, although I'm always happy to review patches. Best, > > thanks. > > samuel -- Eric Schulte https://cs.unm.edu/~eschulte PGP: 0x614CA05D