blob 7f5177226a8635b8e7dbfa8cebb7775f93c25b92 724 bytes (raw)
name: testing/examples/ob-awk-test.org # note: path name is non-authoritative(*)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
| | #+Title: a collection of examples for ob-awk tests
#+OPTIONS: ^:nil
* Simple tests
:PROPERTIES:
:ID: 9e998b2a-3581-43fe-b26d-07d3c507b86a
:END:
Run without input stream
#+begin_src awk :ouput silent :results silent
BEGIN {
print 42
}
#+end_src
Use a code block ouput as an input
#+begin_src awk :stdin genseq :results silent
{
print 42+$1
}
#+end_src
Use input file
#+srcname: genfile
#+begin_src awk :in-file ob-awk-test.in :results silent
$0~/[\t]*#/{
# skip comments
next
}
{
print $1*10
}
#+end_src
* Input data generators
A code block to generate input stream
#+srcname: genseq
#+begin_src emacs-lisp :results silent
(print "1")
#+end_src
|
debug log:
solving 7f51772 ...
found 7f51772 in https://git.savannah.gnu.org/cgit/emacs/org-mode.git
(*) Git path names are given by the tree(s) the blob belongs to.
Blobs themselves have no identifier aside from the hash of its contents.^
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).