doc/Commands: add example of nesting pipes and substitutions

This commit is contained in:
Pragmatic Software 2023-05-20 09:39:49 -07:00
parent 8934936658
commit 38a0b8705f
2 changed files with 13 additions and 0 deletions

View File

@ -9,6 +9,7 @@
* [Chaining](#chaining)
* [Piping](#piping)
* [Substitution](#substitution)
* [Nesting Pipes and Substitutions](#nesting-pipes-and-substitutions)
* [Variables](#variables)
* [Selectors](#selectors)
* [Background processing](#background-processing)
@ -295,6 +296,16 @@ factoid otherwise it will be expanded first.
<pragma-> !img spaces & stuff
<PBot> https://google.com/search?tbm=isch&q=spaces%20%26%20stuff
### Nesting Pipes and Substitutions
Both [Piping](#Piping) and [Substitutions](#Substitution) can be nested.
For example:
<pragma-> !echo $randomnick's IQ is &{roll 1d50+70}
<PBot> mnrmnaugh's IQ is rolled 1d50+70 for 85.
<pragma-> !echo $randomnick's IQ is &{roll 1d50+70 | {sed s/rolled.*for //}}
<PBot> ntwk's IQ is 110.
### Variables
You can use factoids as variables and interpolate them within commands.

View File

@ -52,6 +52,7 @@
* [Chaining](Commands.md#chaining)
* [Piping](Commands.md#piping)
* [Substitution](Commands.md#substitution)
* [Nesting Pipes and Substitutions](Commands.md#nesting-pipes-and-substitutions)
* [Variables](Commands.md#variables)
* [Selectors](Commands.md#selectors)
* [Background processing](Commands.md#background-processing)
@ -342,6 +343,7 @@
* [Initial virtual machine set-up complete](VirtualMachine.md#initial-virtual-machine-set-up-complete)
* [Start PBot VM Host](VirtualMachine.md#start-pbot-vm-host)
* [Test PBot](VirtualMachine.md#test-pbot)
* [QEMU command from libvirt](VirtualMachine.md#qemu-command-from-libvirt)
<!-- md-toc-end -->
<!-- md-toc-begin -->
* [Frequently Asked Questions](FAQ.md#frequently-asked-questions)