github.com/informationsea/shellflow@v0.1.3/docs/source/flowscript.rst (about) 1 Flowscript 2 ========== 3 4 Flowscript is embedded language in shellflow. It is used in enclosed 5 region with double curly brackets ``{{}}`` and lines starts with ``#%``. 6 You can try flowscript in REPL with running ``shellflow flowscript``. 7 8 Syntax 9 ------ 10 11 String 12 ~~~~~~ 13 14 Strings shoulde be enclosed with double quote ``"`` 15 16 Example: ``"value"`` 17 18 Built-in functions 19 ------------------ 20 21 basename 22 ~~~~~~~~ 23 24 Return base name of a path. if a suffix is provided and found in the 25 path, this function removes the suffix. 26 27 - ``basename("hoge/foo.c") => "foo.c"`` 28 - ``basename("hoge/foo.c", ".c") => "foo"`` 29 30 dirname 31 ~~~~~~~ 32 33 Return directory name of a path. 34 35 - ``dirname("bar/hoge/foo.c") => "var/hoge"`` 36 37 prefix 38 ~~~~~~ 39 40 add prefix to arrayed string 41 42 ``prefix("hoge", ["foo", "bar", "hoge"]) => ["hogefoo", "hogebar", "hogehoge"]`` 43 44 zip 45 ~~~ 46 47 Zip two arrays and create an array of arrays. 48 49 ``zip([1,2,3], [4,5,6,7]) => [[1,4], [2,5], [3,6]]``