From 68327fda24b852ec4daed02ad677c49da75c38aa Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Tue, 29 Jun 2021 11:04:54 +0530 Subject: doc: Document passing input into stdin. * doc/ccwl.skb (Tutorial)[Passing input into the standard input stream of a command]: New section. * doc/pass-stdin.scm, doc/pass-stdin.out: New files. --- doc/ccwl.skb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'doc/ccwl.skb') diff --git a/doc/ccwl.skb b/doc/ccwl.skb index 51ce5bf..2fec996 100644 --- a/doc/ccwl.skb +++ b/doc/ccwl.skb @@ -149,6 +149,21 @@ output.]) (prog :line #f (source :file "doc/capture-output-file-with-parameter-reference.out"))) + (section :title [Passing input into the standard input stream of a command] + (p [Some commands read input from their standard input +stream. Let us do that from ccwl. The workflow below reports the size +of a file by passing it into the standard input of +,(command "wc"). Notice the additional ,(code "#:stdin") keyword that +references the input ,(code "file").]) + + (scheme-source "doc/pass-stdin.scm") + + (p [Compiling and running this workflow gives us the following +output. Notice the file ,(file "foo") passed into the standard input +of ,(command "wc"), and the file size reported in bytes.]) + + (prog :line #f (source :file "doc/pass-stdin.out"))) + (section :title [Workflow with multiple steps] (p [Till now, we have only written trivial workflows with a single command. If we were only interested in executing single -- cgit v1.2.3