How can I insert a horizontal line (hline) in a bash/sh source code block? My goal is to separate the header line from the rest.
#+begin_src sh
echo "header1,header2"
echo "???" # placeholder for the magic value
echo "value1,value2"
echo "value1,value2"
#+end_src
The desired outcome would be
#+RESULTS:
| header1 | header2 |
|---------+---------|
| value1 | value2 |
| value1 | value2 |
In a Python src block I can insert a None
-Value and get an hline. I hope there is a possibility.
Edit: @jagrg answers solves the problem to separate the header from the rest I would also to insert a hline at any point in the table. Here is the expected outcome.
#+begin_src bash :colnames '("header1" "header2")
echo "value1,value2"
echo "value1,value2"
echo "???" # magic value
echo "value1,value2"
#+end_src
#+RESULTS:
| header1 | header2 |
|---------+---------|
| value1 | value2 |
| value1 | value2 |
|---------+---------|
| value1 | value2 |
I tried echo hline
and echo "hline"
with no success. I also looked in the code of ob-shell.el
and it looks that a simple echo hline
should do it but it doesn't.