Document trim option for shell commands. Fix #201

This commit is contained in:
Federico Terzi 2020-03-20 21:25:24 +01:00
parent ebbe889cc5
commit 6a85aeb444

View File

@ -397,6 +397,24 @@ This extension also supports bash **pipes** as your shell, such as:
``` ```
{% endraw %} {% endraw %}
#### Trimming the output
When working with commands, it's very common to have outputs that also spawn a newline at the end. If you want to remove any
excess spaces/newlines, you can use the `trim` option:
{% raw %}
```yml
- trigger: ":localip"
replace: "{{output}}"
vars:
- name: output
type: shell
params:
cmd: "ip a | grep 'inet 192' | awk '{ print $2 }'"
trim: true
```
{% endraw %}
### Date Extension ### Date Extension
The **Date Extension** can be used to include *date* and *time* information in a match. The **Date Extension** can be used to include *date* and *time* information in a match.