Supported Platforms
Related Documentation
- ACX, EX, M, MX, PTX, SRX, T Series
- Summary of Extension Functions in the jcs and slax Namespaces
- get-input() Function (jcs and slax Namespaces)
- get-secret() Function (jcs and slax Namespaces)
- printf() Function (jcs and slax Namespaces)
- progress() Function (jcs and slax Namespaces)
- syslog() Function (jcs and slax Namespaces)
- trace() Function (jcs and slax Namespaces)
- ACX, EX, M, MX, SRX, T Series
- Junos Script Automation: Understanding Extension Functions in the jcs and slax Namespaces
output() Function (jcs and slax Namespaces)
Namespaces
SLAX Syntax
XSLT Syntax
Release Information
Function introduced in Junos OS Release 7.6.
Support for the slax namespace http://xml.libslax.org/slax added in Junos OS Release 12.2.
Description
Display one or more lines of output text, either to the CLI user (when used in op scripts), or to the output file (when used in event scripts). The function can be called with either a single string argument or with multiple string arguments. Multiple arguments are concatenated into one combined string. A newline terminates the output text.
jcs:output() is not supported in commit scripts. Commit scripts use the <xnm:warning> and <xnm:error> result tree elements to display text to the CLI user.
The behavior of jcs:output() differs from the<output> result tree element in that jcs:output() displays its text immediately, rather than waiting until the conclusion of the script. This makes it suitable for scripts where user interaction is required, such as when the jcs:get-input() function is used, or when status messages should be displayed in the midst of script processing. While jcs:output() does return a node set, it is always empty and can be ignored. Therefore, the jcs:output() function is normally called with the expr statement, rather than assigning its result to a variable.
The following escape characters are supported in the output text:
- \\ –Backslash (as of Junos OS Release 10.2)
- \r –Carriage Return
- \" –Double-quote (as of Junos OS Release 10.1R2)
- \n –Newline
- \' – Single-quote
- \t –Tab
Starting with Junos OS Release 10.2, the maximum length for output text is 10 KB, and longer strings are truncated to the supported length.
The prefix associated with the namespace URI should be defined in the prefix-to-namespace mapping in the style sheet.
Parameters
string | — | Text that is output immediately to the CLI session. |
Usage Examples
SLAX syntax:
expr jcs:output('The VPN is up.');
XSLT syntax:
<xsl:value-of select="jcs:output('The VPN is up.')"/>
Related Documentation
- ACX, EX, M, MX, PTX, SRX, T Series
- Summary of Extension Functions in the jcs and slax Namespaces
- get-input() Function (jcs and slax Namespaces)
- get-secret() Function (jcs and slax Namespaces)
- printf() Function (jcs and slax Namespaces)
- progress() Function (jcs and slax Namespaces)
- syslog() Function (jcs and slax Namespaces)
- trace() Function (jcs and slax Namespaces)
- ACX, EX, M, MX, SRX, T Series
- Junos Script Automation: Understanding Extension Functions in the jcs and slax Namespaces
Published: 2013-07-26
Supported Platforms
Related Documentation
- ACX, EX, M, MX, PTX, SRX, T Series
- Summary of Extension Functions in the jcs and slax Namespaces
- get-input() Function (jcs and slax Namespaces)
- get-secret() Function (jcs and slax Namespaces)
- printf() Function (jcs and slax Namespaces)
- progress() Function (jcs and slax Namespaces)
- syslog() Function (jcs and slax Namespaces)
- trace() Function (jcs and slax Namespaces)
- ACX, EX, M, MX, SRX, T Series
- Junos Script Automation: Understanding Extension Functions in the jcs and slax Namespaces