Synsh (synsh.dev) automatically creates shell pipelines from example inputs and outputs.
Suppose we want to find a pipeline to transform the following comma-separated input:
Arthur,2 Octavia,3 Margaret,1
to the following space-separated output, in which each line has been sorted by the numeric value, and the number comes first:
1 Margaret 2 Arthur 3 Octavia
First, we enter the input into the "input" text box:
Next, we enter the desired output into the "output" text box. Suppose that, to start with, we have only entered the first line of the output so far. Synsh searches for a pipeline mapping the input to the output as we type, so it will find a pipeline that maps our complete input to our partially-entered output:
Note that, along with the pipeline itself, Synsh outputs a comment describing what the pipeline does.
Note also that Synsh displays two buttons above the pipeline:
The link button: pressing this button gives you a URL to use to share the current page, including the input, output, and the pipeline that Synsh found.
The copy button: Pressing this button copies the pipeline to the clipboard.
Once we've finished entering the full output, Synsh finds and displays the pipeline we want:
To keep track of updates to Synsh, see the Synsh blog.