From 38a0b8705fb34ac543a01b76b4ad1df9eabf8265 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Sat, 20 May 2023 09:39:49 -0700 Subject: [PATCH] doc/Commands: add example of nesting pipes and substitutions --- doc/Commands.md | 11 +++++++++++ doc/README.md | 2 ++ 2 files changed, 13 insertions(+) diff --git a/doc/Commands.md b/doc/Commands.md index 2f69b15f..e6c2c01f 100644 --- a/doc/Commands.md +++ b/doc/Commands.md @@ -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. !img spaces & stuff 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: + + !echo $randomnick's IQ is &{roll 1d50+70} + mnrmnaugh's IQ is rolled 1d50+70 for 85. + !echo $randomnick's IQ is &{roll 1d50+70 | {sed s/rolled.*for //}} + ntwk's IQ is 110. + ### Variables You can use factoids as variables and interpolate them within commands. diff --git a/doc/README.md b/doc/README.md index 0f1f57a1..005a274b 100644 --- a/doc/README.md +++ b/doc/README.md @@ -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) * [Frequently Asked Questions](FAQ.md#frequently-asked-questions)