Pipelines

A sequence of operators, connected by pipes, is a pipeline. While marcel usage often involves just running one pipeline and seeing the results, you can also store pipelines for later use, similar to the writing of a function in a programming language.


For example, here is a pipeline that searches the current directory recursively, and lists the files that have been modified in the past day:

This creates a pipeline, and assigns it to the environment variable recent. Running it:

You can generalize this, by paramaterizing the pipeline. For example, here is a pipeline that explores the current directory recursively and lists the files that have been modified within a given number of days:

You can specify a value for the parameter positionally:

recent 1 would bind the string '1' to the parameter n. We want the integer 1, which is obtained by using parentheses to delimit a Python expression.

If you prefer, you can use a short flag, if the parameter's name is a single-character string:

You can also use a long option, for any parameter, e.g. recent --n (1).

  • github
  • Twitter
  • email