Contents
System
Description
This will run unix-command on the server and include its output in the page in which it is specified formatted according to inclusion-mode, which may be one of:
raw - the output is assumed to be HTML
wiki - the output is assumed to be normal wiki markup
pre - the output is treated as normal wiki markup enclosed between '{{{' and '}}}'.
Be aware that if a page is editable by anyway then anyway could insert calls to this macro in order to run any command on your computer. Imagine if they put something like:
[[System(cat /etc/passwd,raw)]]
Download & Release Notes
Download |
Release Version |
Moin Version |
Release Notes |
20131031 |
1.5.8 |
final version by AlexisHuxley |
Usage
Syntax: [[System(unix-command,inclusion-mode)]]
Example
Example #1:
The output of man pdb, pre-formatted:
[[System(man pdb,pre)]]
Example #2:
An inline shell script generating wiki markup:
[[System(date ,wiki)]]
Example #3:
The HTML output of w3m -dump_source http://checkip.dyndns.org/:
[[System(w3m -dump_source http://checkip.dyndns.org/ 2>/dev/null,raw)]]
Example #4:
Here's a Google Maps map embedded in a wiki page:
[[System(echo "<iframe width=\"800\" height=\"350\" frameborder=\"0\" scrolling=\"no\" marginheight=\"0\" marginwidth=\"0\" src=\"http://maps.google.com/maps?f=q&hl=en&geocode=&q=oberammergau+bahnhof&sll=47.595608%2C11.066837&sspn=0.005072%2C0.010471&ie=UTF8&s=AARTsJpW-Xn5cQHRchUDNrmbbLGggtcVfA&ll=47.597713%2C11.073446&spn=0.010129%2C0.034332&z=15&output=embed\"></iframe>",raw)]]
Note that the Google Maps URL has had:
- commas changed to %2C to prevent Moin interpreting them as macro argument separators,
- double quotes have been backslash-escaped to prevent the shell from interpreting them as string delimiters.
Copyright & license
(C) AlexisHuxley 2007-2011 and are distributed under the terms of the GPL.
Bugs