Skip to content

Latest commit

 

History

History
52 lines (38 loc) · 909 Bytes

input.md

File metadata and controls

52 lines (38 loc) · 909 Bytes

Send input and pipe commands

Use a stdin block for input, or pipe one command's stdout into another. These examples use the test CLI, mm-test-cli.

Send text to stdin

```markmason
mm-test-cli cat
```

The block is sent to stdin with a final newline.

```stdin
hello
from stdin
```

```expected
hello
from stdin
```

Pipe output through multiple commands

```markmason
mm-test-cli echo "hello | world" | mm-test-cli cat | mm-test-cli cat
```

Pipes connect stdout between stages. The quoted `|` stays inside its argument.

```expected
hello | world
```

Preserve quoted and empty arguments

```markmason
mm-test-cli args "hello | world" "" "last value"
```

Quotes preserve spaces and empty arguments. Commands run without a shell.

```expected
["hello | world", "", "last value"]
```