Help:Script Samples: Difference between revisions

Content deleted Content added
No edit summary
Line 170:
|}
 
== <code>&lt;code&gt;</code> element ==
 
Code tags are used for single lines of script only:<br><br>
<code>&lt;code&gt;</code><code>[root@node0-mraid14 /fse]# dd if=/dev/lun2 | od -c |less</code><code> &lt;/code&gt;</code>
<br><br>
 
== <code>&lt;pre&gt;</code> element ==
 
Pre tags do not automatically shrink to fit their contents, use the class "inline" for auto fitting, this uses "display: inline-block" in the css:<br><br>
<code>&lt;pre class="inline"&gt;</code>
<pre class="inline">
[root@node0-FS8600 /fse]# system-status
 
General System Status
-- Section ---- Section ---- Section ---- Section ---- Section ---- Section ---- Section ---- Section ---- Section ---- Section ----
expected status is ON
File system is up
 
Health Status
-- Section ---- Section ---- Section ---- Section ---- Section ---- Section ---- Section ---- Section ---- Section ---- Section ----
system health ok
 
[root@node0-FS8600 /fse]#
</pre>
<code>&lt;/pre&gt;</code>
<br/><br/>
 
== <code>&lt;pre&gt;</code> element (with set-width) ==
 
In order to show the scroll bars on a pre element it is necessary to use the class "scroll" and it maybe necessary to statically set the '''width''':<br><br>
<code>&lt;pre class="scroll" style="width: 500px;"&gt;</code>
<pre class="scroll" style="width: 500px;">
<FluidFS> CLI > system authentication user-database set ldap -ldap_host ldap.furryyoghurt.com -ldap_base_dn "dc=exanet,dc=local"
<FluidFS> CLI >
</pre>
<code>&lt;/pre&gt;</code>
<br><br>
 
== <code>&lt;syntax-highlight lang="bash"&gt;</code> element ==
 
The syntaxhighlight tag requires the programming language to be specified in this case '''bash''':<br><br>
<code>&lt;syntaxhighlight lang="bash" class="inline"&gt;</code>
<syntaxhighlight lang="bash" class="inline">
#!/bin/bash
fileCount=800000
b=0
while [ $b -le $fileCount ]
do
echo B = $b
dd if=/dev/urandom of=/mnt/nfs/file$b.txt bs=2k count=1
((b++))
done
</syntaxhighlight>
<code>&lt;/syntaxhighlight&gt;</code>
<br/><br/>
 
* For more details on usage, see the [http://www.mediawiki.org/wiki/Extension:SyntaxHighlight_GeSHi Mediawiki SyntaxHighlight Extension]
 
<br><br>
----
<br><br>
 
If a programming language is not used the language can be specified as '''text''', also the highlight attribute can be set to highlight lines of code:<br><br>