* Achim Gratz <[email protected]> wrote:
> Karl Voit writes:
>> echo "testing stderr with manual redirect" 2>&1 >&2
>
> The last redirection ">&2" is nonsense, it only works because STDERR is
> already reopened on STDOUT and redirection to the same file descriptor
> is ignored.
Absolutely right. Must have been a non-deleted artefact after I
tested something different in that line.
> And to solve your original problem:
>
> #+BEGIN_SRC sh :results output
> exec 2>&1
> echo "testing stdout" >&1
> echo "testing stderr" >&2
> date -g
> :
> #+END_SRC
Together with the '{ ... } 2>&1' trick, this is a valid workaround.
What I wanted to achieve is a re-direct of any (sh) babel script
without this exec-command I do have to add.
However, I could imagine an additional babel-parameter like ":stderr
redirect" (or something more meaningful) because in most cases I
have to add the ":results output" line as well.
--
mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML to Org-mode:
> get Memacs from https://github.com/novoid/Memacs <
https://github.com/novoid/extract_pdf_annotations_to_orgmode + more on github