Skip to content

Examples

Below are some examples of the plugin in action. First is the required tag to use in the Markdown file, then the output of the command.

Run the 'cowsay' command!

{{ run-shell-cmd(cmd="cowsay This works!!!") }}

$ cowsay This works!!!
  _____________
| This works!!! |
  =============
             \
              \
                ^__^
                (oo)\_______
                (__)\       )\/\
                    ||----w |
                    ||     ||

Show the build OS information:

{{ run-shell-cmd(cmd='lsb_release -a') }}

$ lsb_release -a
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.2 LTS
Release:    22.04
Codename:   jammy

Ping google.com 3 times and show the output.:

{{ run-shell-cmd(cmd='ping -c 3 google.com') }}

$ ping -c 3 google.com
PING google.com (142.250.187.238) 56(84) bytes of data.
64 bytes from lhr25s34-in-f14.1e100.net (142.250.187.238): icmp_seq=1 ttl=115 time=34.8 ms
64 bytes from lhr25s34-in-f14.1e100.net (142.250.187.238): icmp_seq=2 ttl=115 time=35.7 ms
64 bytes from lhr25s34-in-f14.1e100.net (142.250.187.238): icmp_seq=3 ttl=115 time=31.3 ms

--- google.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2008ms
rtt min/avg/max/mdev = 31.296/33.935/35.663/1.895 ms