[fd4e91]: impnotes / getenv.html Maximize Restore History

Download this file

getenv.html    14 lines (13 with data), 5.5 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:cf="http://docbook.sourceforge.net/xmlns/chunkfast/1.0"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>31.9. Operating System Environment.</title><link rel="stylesheet" href="impnotes.css" type="text/css" /><link rev="made" href="mailto:clisp-list@sf.net" /><meta name="generator" content="DocBook XSL Stylesheets V2005-07-12_04:47_snapshot" /><link rel="start" href="index.html" title="Implementation Notes for GNU CLISP." /><link rel="up" href="ext-platform.html" title="Chapter 31. Platform Specific Extensions" /><link rel="prev" href="shell.html" title="31.8. Shell, Pipes and Printing" /><link rel="next" href="ext-modules.html" title="Chapter 32. Extensions Implemented as Modules" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">31.9. Operating System Environment.</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="shell.html">Prev</a> </td><th width="60%" align="center">Chapter 31. Platform Specific Extensions</th><td width="20%" align="right"> <a accesskey="n" href="ext-modules.html">Next</a></td></tr></table><hr /></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="getenv"></a>31.9. Operating System Environment.</h2></div></div></div><p>Most modern operating systems support <a href="http://www.opengroup.org/onlinepubs/007904975/basedefs/xbd_chap08.html" target="_top">environment variable</a>s that associate
strings (“<span class="quote">variables</span>”) with other strings
(“<span class="quote">values</span>”). These variables are somewhat similar to the
<a href="http://www.lisp.org/HyperSpec/Body/dec_special.html" target="_top"><code class="literal">SPECIAL</code></a> variables in <a href="http://www.lisp.org" target="_top"><span><strong class="command">Common Lisp</strong></span></a>: their values are inherited by the
processes from their parent process.</p><p>You can access your OS <a href="http://www.opengroup.org/onlinepubs/007904975/basedefs/xbd_chap08.html" target="_top">environment variable</a>s using the function
<code class="code">(<a href="getenv.html" title="31.9. Operating System Environment."><code class="function">EXT:GETENV</code></a> <a href="http://www.lisp.org/HyperSpec/Body/sec_3-4-1.html" target="_top"><code class="literal">&amp;OPTIONAL</code></a> <em class="replaceable"><code>string</code></em>)</code>,
where <em class="replaceable"><code>string</code></em> is the name of the <a href="http://www.opengroup.org/onlinepubs/007904975/basedefs/xbd_chap08.html" target="_top">environment variable</a>.
When <em class="replaceable"><code>string</code></em> is omitted or <a href="http://www.lisp.org/HyperSpec/Body/convar_nil.html" target="_top"><code class="constant">NIL</code></a>, all the <a href="http://www.opengroup.org/onlinepubs/007904975/basedefs/xbd_chap08.html" target="_top">environment variable</a>s and their values
are returned in an <a href="http://www.lisp.org/HyperSpec/Body/glo_a.html#association_list" target="_top">alist</a>.</p><p>You can change the value of existing <a href="http://www.opengroup.org/onlinepubs/007904975/basedefs/xbd_chap08.html" target="_top">environment variable</a>s or create new ones
using <code class="code">(<a href="http://www.lisp.org/HyperSpec/Body/mac_setfcm_psetf.html" target="_top"><code class="function">SETF</code></a> (<a href="getenv.html" title="31.9. Operating System Environment."><code class="function">EXT:GETENV</code></a> <em class="replaceable"><code>string</code></em>) <em class="replaceable"><code>new-value</code></em>)</code>.
</p></div><div class="bookinfo"><hr width="100%" /><table width="100%" summary="impnotes meta info"><th><td align="left">These notes document <a href="http://clisp.cons.org" target="_top"><span><strong class="command">CLISP</strong></span></a> version 2.34.</td><td align="right">Last modified: 2005-07-20</td></th></table></div><div class="custom-footer"><hr width="100%" /><table width="100%"><tr><td align="left"><a href="http://clisp.cons.org"><img src="clisp.png" width="48" height="48" alt="[CLISP home]" /></a></td><td align="center"><a href="http://www.gnu.org"><img src="http://www.gnu.org/graphics/gnubanner.jpg" width="468" height="60" alt="[Come and see what GNU creates for YOU]" /></a></td><td align="right"><a href="http://sourceforge.net"><img width="125" height="37" alt="[SourceForge]" src="http://sflogo.sourceforge.net/sflogo.php?group_id=1355&amp;type=2&amp;page=getenv" /></a></td></tr></table></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="shell.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ext-platform.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ext-modules.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">31.8. Shell, Pipes and Printing </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 32. Extensions Implemented as Modules</td></tr></table></div></body></html>