Environment.html 4.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <html lang="en">
  2. <head>
  3. <title>Environment - avram - a virtual machine code interpreter</title>
  4. <meta http-equiv="Content-Type" content="text/html">
  5. <meta name="description" content="avram - a virtual machine code interpreter">
  6. <meta name="generator" content="makeinfo 4.13">
  7. <link title="Top" rel="start" href="index.html#Top">
  8. <link rel="up" href="User-Manual.html#User-Manual" title="User Manual">
  9. <link rel="prev" href="Files.html#Files" title="Files">
  10. <link rel="next" href="Bugs.html#Bugs" title="Bugs">
  11. <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
  12. <meta http-equiv="Content-Style-Type" content="text/css">
  13. <style type="text/css"><!--
  14. pre.display { font-family:inherit }
  15. pre.format { font-family:inherit }
  16. pre.smalldisplay { font-family:inherit; font-size:smaller }
  17. pre.smallformat { font-family:inherit; font-size:smaller }
  18. pre.smallexample { font-size:smaller }
  19. pre.smalllisp { font-size:smaller }
  20. span.sc { font-variant:small-caps }
  21. span.roman { font-family:serif; font-weight:normal; }
  22. span.sansserif { font-family:sans-serif; font-weight:normal; }
  23. --></style>
  24. </head>
  25. <body>
  26. <div class="node">
  27. <a name="Environment"></a>
  28. <p>
  29. Next:&nbsp;<a rel="next" accesskey="n" href="Bugs.html#Bugs">Bugs</a>,
  30. Previous:&nbsp;<a rel="previous" accesskey="p" href="Files.html#Files">Files</a>,
  31. Up:&nbsp;<a rel="up" accesskey="u" href="User-Manual.html#User-Manual">User Manual</a>
  32. <hr>
  33. </div>
  34. <h3 class="section">1.10 Environment</h3>
  35. <p><a name="index-environment-131"></a><a name="index-g_t_0040code_007bAVMINPUTS_007d-132"></a><a name="index-paths-133"></a>An environment variable <samp><span class="env">AVMINPUTS</span></samp> can be made to store a list of
  36. directories (using the <samp><span class="command">set</span></samp> or <samp><span class="command">export</span></samp> commands) that
  37. <code>avram</code> will search for input files. The directories should be
  38. separated by colons, similarly to the <samp><span class="env">PATH</span></samp> environment variable.
  39. <p><a name="index-search-paths-134"></a>The search paths in <samp><span class="env">AVMINPUTS</span></samp> apply only to the names of input
  40. files given on the command line (<a href="Command-Line-Syntax.html#Command-Line-Syntax">Command Line Syntax</a>) when
  41. <code>avram</code> is invoked in parameter mode (<a href="Parameter-Mode.html#Parameter-Mode">Parameter Mode</a>). They
  42. do not apply to the name of the virtual code file, which is always
  43. assumed to be either absolute or relative to the current working
  44. directory (this assumption being preferable in the case of a script like
  45. that of <a href="Example-Script.html#Example-Script">Example Script</a>).
  46. <a name="index-shell-script-135"></a>
  47. Starting in the first directory in the list of <samp><span class="env">AVMINPUTS</span></samp>,
  48. <code>avram</code> searches for a file exactly as its name appears on
  49. the command line (subject to the expansion of special characters
  50. by the shell). If it is not found and the name does not contain a
  51. period, but a command line option of <samp><span class="option">-.EXT</span></samp> has been used,
  52. <code>avram</code> will then search for a file with that name combined with
  53. the extension <code>.EXT</code>. If <samp><span class="option">-.EXT</span></samp> has not been used or if no
  54. <a name="index-g_t_0040code_007bEXT_007d-command-line-option-136"></a>matching file is found with it, <code>avram</code> tries the extensions of
  55. <kbd>.avm</kbd> and <kbd>.fun</kbd> in that order, provided the given file name
  56. contained no periods. If no match is found for any of those cases,
  57. <code>avram</code> proceeds to search the next directory in the list obtained
  58. from <samp><span class="env">AVMINPUTS</span></samp>, and so on. It stops searching when the first
  59. match is found. For subsequent input files, the search begins again at
  60. the first directory.
  61. <p>If <samp><span class="env">AVMINPUTS</span></samp> is defined, the current working directory is not
  62. searched for input files unless it is listed. If it is empty or not
  63. <a name="index-search-paths-137"></a>defined, a default list of search paths is used, currently
  64. <pre class="example"> .:/usr/local/lib/avm:/usr/lib/avm:/lib/avm:/opt/avm:/opt/lib/avm\
  65. :/usr/local/share/avm:/usr/share/avm:/share/avm:/opt/avm:/opt/share/avm
  66. </pre>
  67. <p class="noindent">These paths are defined in <code>avram.c</code> and can be changed
  68. by recompiling it.
  69. </body></html>