ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzahz_5.4.0.1/readonly.htm

100 lines
2.6 KiB
HTML
Raw Permalink Normal View History

2024-04-02 14:02:31 +00:00
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<meta name="generator" content="HTML Tidy, see www.w3.org">
<meta http-equiv="Content-Type" content=
"text/html; charset=utf-8">
<title>readonly - Set read-only attribute for variables</title>
<LINK rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</HEAD>
<body bgcolor="#FFFFFF">
<!-- Java sync-link -->
<SCRIPT LANGUAGE="Javascript" SRC="../rzahg/synch.js" TYPE="text/javascript"></SCRIPT>
<h2>readonly - Set read-only attribute for variables</h2>
<strong>Synopsis</strong>
<p><strong>readonly</strong> [ <strong>-p</strong> ] [ <em>
name</em> [ <em>=value</em> ] ... ]</p>
<p><strong>Description</strong></p>
<p>You can use <strong>readonly</strong> to set the read-only
attribute for the variables specified by <em>name</em>. A
variable with the read-only attribute cannot have its value changed
by a subsequent assignment and cannot be unset.</p>
<p>Note that <strong>qsh</strong> can change the value of a
variable with the read-only attribute. For example, if <strong>
PWD</strong> has the read-only attribute, it's value will be
changed when you change the current working directory.</p>
<p>When no arguments are specified, <strong>qsh</strong> displays a
list of the variables with the read-only attribute and their
values.</p>
<p><strong>Options</strong></p>
<dl>
<dt><strong>-p</strong></dt>
<dd>Precede each line of the output with the word "readonly " so it
is displayed in a re-enterable format.</dd>
</dl>
<p><strong>Operands</strong></p>
<p>Each <em>name</em> specifies a variable in the current
environment. If a <em>value</em> is also specified, the value of
the variable is updated before setting the read-only attribute.</p>
<p><strong>Exit Status</strong></p>
<ul>
<li>0 when successful.</li>
<li>&gt;0 when unsuccessful.</li>
</ul>
<p><strong>Related information</strong></p>
<ul>
<li><a href="declare.htm">declare - Declare variables and set attributes</a></li>
<li><a href="export.htm">export - Set export attribute for variables</a></li>
<li><a href="local.htm">local - Assign a local variable in a function</a></li>
<li><a href="set.htm">set - Set or unset options and positional parameters</a></li>
<li><a href="unset.htm">unset - Unset values of variables and functions</a></li>
</ul>
<strong>Examples</strong>
<ol>
<li>Set the read-only attribute for an existing variable:
<pre>
readonly ALPHA
</pre>
</li>
<li>Set the value and read-only attribute of a new variable:
<pre>
readonly ALPHA=one
</pre>
</li>
<li>List all variables with the read-only attribute:
<pre>
readonly
</pre>
</li>
</ol>
</body>
</html>