Including a command within the wiki: Difference between revisions

Jump to navigation Jump to search
Marked this version for translation
No edit summary
(Marked this version for translation)
Line 2: Line 2:


<translate>
<translate>
<!--T:1-->
To include a command within the wiki, you should use the <nowiki>{{Commande}}</nowiki> template. This template detects the '''bash''' syntax. For example, the code
To include a command within the wiki, you should use the <nowiki>{{Commande}}</nowiki> template. This template detects the '''bash''' syntax. For example, the code
<syntaxhighlight lang=text>
<syntaxhighlight lang=text>
Line 9: Line 10:
{{Command|cd src; make && make install; cd ..}}
{{Command|cd src; make && make install; cd ..}}


== Including a "{{=}}" within a command ==
== Including a "{{=}}" within a command == <!--T:2-->
Since <nowiki>{{Command}}</nowiki> is a template, the "=" signs are interpreted by the wiki. To include an equality sign, use the [[Template:=|meta-template <nowiki>{{=}}</nowiki>]]. For example, the code:
Since <nowiki>{{Command}}</nowiki> is a template, the "=" signs are interpreted by the wiki. To include an equality sign, use the [[Template:=|meta-template <nowiki>{{=}}</nowiki>]]. For example, the code:
<syntaxhighlight lang=text>
<syntaxhighlight lang=text>
Line 17: Line 18:
{{Command|./configure --prefix{{=}}$HOME && make && make install}}
{{Command|./configure --prefix{{=}}$HOME && make && make install}}


== Including a set of commands ==
== Including a set of commands == <!--T:3-->
You can use the <nowiki>{{Commands}}</nowiki> template to include a set of commands. You may then write each command on a separate line, and prepend the '''|''' character in front of each command. For example, the code
You can use the <nowiki>{{Commands}}</nowiki> template to include a set of commands. You may then write each command on a separate line, and prepend the '''|''' character in front of each command. For example, the code
<syntaxhighlight lang=text>
<syntaxhighlight lang=text>
Line 35: Line 36:
}}
}}


== Modifying the command prompt ==
== Modifying the command prompt == <!--T:4-->
If you want to modify the command prompt, you may do it by including a ''prompt'' argument to the template. For example,  
If you want to modify the command prompt, you may do it by including a ''prompt'' argument to the template. For example,  
<syntaxhighlight lang=text>{{Command|prompt=[name@briaree ~]|cd src; make && make install; cd ..}}</syntaxhighlight>
<syntaxhighlight lang=text>{{Command|prompt=[name@briaree ~]|cd src; make && make install; cd ..}}</syntaxhighlight>
Line 41: Line 42:
{{Command|prompt=[name@briaree ~]|cd src; make && make install; cd ..}}
{{Command|prompt=[name@briaree ~]|cd src; make && make install; cd ..}}


<!--T:5-->
In the same way,  
In the same way,  
<syntaxhighlight lang=text>
<syntaxhighlight lang=text>
Line 60: Line 62:
}}
}}


== Displaying the result of a command ==
== Displaying the result of a command == <!--T:6-->
You can display the result of a command (and only one) by adding the option <tt>result</tt>. For example,  
You can display the result of a command (and only one) by adding the option <tt>result</tt>. For example,  
<syntaxhighlight>
<syntaxhighlight>
Bureaucrats, cc_docs_admin, cc_staff, rsnt_translations
2,837

edits

Navigation menu