github.com/informationsea/shellflow@v0.1.3/docs/source/syntax.rst (about)

     1  Syntax
     2  ======
     3  
     4  A syntax of shellflow is very similar to bash script. Most important
     5  difference is annotating input files and output files with parentheses
     6  and brackets.
     7  
     8  Input files
     9  -----------
    10  
    11  All input files should be enclosed with parentheses.
    12  
    13  .. code:: bash
    14  
    15      cat ((INPUT_FILE))
    16  
    17  If some input files are not appeared in command line, it should be
    18  written in comment.
    19  
    20  .. code:: bash
    21  
    22      gcc ((hello.c)) # ((hello.h))   this command depends on hello.c and hello.h
    23  
    24  When glob is used, all input files should be exists in advanced of
    25  shellflow runing.
    26  
    27  Output files
    28  ------------
    29  
    30  All output files should be enclosed with brackets.
    31  
    32  .. code:: bash
    33  
    34      date >> [[OUTPUT]]
    35  
    36  Varaible
    37  --------
    38  
    39  A varaible should be enclosed with curly brackets, when the variable is
    40  used in command line.
    41  
    42  .. code:: bash
    43  
    44      echo {{variable}}
    45  
    46  To set value to variable, flowscript, embedded script language in
    47  shellflow, or parameter file should be used. When a line starts with
    48  ``#%``, the line will be parsed as flowscript.
    49  
    50  .. code:: bash
    51  
    52      #% varaible = "foo"
    53  
    54  Loop
    55  ----
    56  
    57  ``for`` loop is supported in shellflow. ``do`` and ``done`` are required
    58  in shellflow.
    59  
    60  .. code:: bash
    61  
    62      for x in a b c; do
    63          echo {{x}} > {{x}}
    64      done
    65  
    66  Variable names should be enclosed with curly brackets.
    67  
    68  When glob is used, all input files should be exists in advanced of
    69  shellflow runing.
    70  
    71  if
    72  --
    73  
    74  ``if`` statement is not supported currently.