1 /***********************************************************************
3 * This software is part of the ast package *
4 * Copyright (c) 1982-2010 AT&T Intellectual Property *
5 * and is licensed under the *
6 * Common Public License, Version 1.0 *
7 * by AT&T Intellectual Property *
9 * A copy of the License is available at *
10 * http://www.opensource.org/licenses/cpl1.0.txt *
11 * (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
13 * Information and Software Systems Research *
17 * David Korn <dgk@research.att.com> *
19 ***********************************************************************/
23 #include "FEATURE/options"
24 #include "FEATURE/dynamic"
29 #include "variables.h"
32 * This is the list of built-in shell variables and default values
33 * and default attributes.
36 const struct shtable2 shtab_variables
[] =
40 "PS2", NV_NOFREE
, "> ",
41 "IFS", NV_NOFREE
, " \t\n",
46 "SHELL", NV_NOFREE
, "/bin/" SH_STD
,
47 "EDITOR", 0, (char*)0,
48 "MAILCHECK", NV_NOFREE
|NV_INTEGER
, (char*)0,
49 "RANDOM", NV_NOFREE
|NV_INTEGER
, (char*)0,
50 "ENV", NV_NOFREE
, (char*)0,
51 "HISTFILE", 0, (char*)0,
52 "HISTSIZE", 0, (char*)0,
53 "HISTEDIT", NV_NOFREE
, (char*)0,
54 "HISTCMD", NV_NOFREE
|NV_INTEGER
, (char*)0,
55 "FCEDIT", NV_NOFREE
, "/bin/ed",
56 "CDPATH", 0, (char*)0,
57 "MAILPATH", 0, (char*)0,
58 "PS3", NV_NOFREE
, "#? ",
59 "OLDPWD", 0, (char*)0,
60 "VISUAL", 0, (char*)0,
61 "COLUMNS", 0, (char*)0,
63 "PPID", NV_NOFREE
|NV_INTEGER
, (char*)0,
64 "_", NV_EXPORT
, (char*)0,
65 "TMOUT", NV_NOFREE
|NV_INTEGER
, (char*)0,
66 "SECONDS", NV_NOFREE
|NV_INTEGER
|NV_DOUBLE
, (char*)0,
67 "LINENO", NV_NOFREE
|NV_INTEGER
, (char*)0,
68 "OPTARG", 0, (char*)0,
69 "OPTIND", NV_NOFREE
|NV_INTEGER
, (char*)0,
73 "LC_ALL", 0, (char*)0,
74 "LC_COLLATE", 0, (char*)0,
75 "LC_CTYPE", 0, (char*)0,
76 "LC_MESSAGES", 0, (char*)0,
77 "LC_NUMERIC", 0, (char*)0,
78 "FIGNORE", 0, (char*)0,
79 "KSH_VERSION", 0, (char*)0,
80 "JOBMAX", NV_NOFREE
|NV_INTEGER
, (char*)0,
81 ".sh", NV_TABLE
|NV_RDONLY
|NV_NOFREE
|NV_NOPRINT
,(char*)0,
82 ".sh.edchar", 0, (char*)0,
83 ".sh.edcol", 0, (char*)0,
84 ".sh.edtext", 0, (char*)0,
85 ".sh.edmode", 0, (char*)0,
86 ".sh.name", 0, (char*)0,
87 ".sh.subscript",0, (char*)0,
88 ".sh.value", 0, (char*)0,
89 ".sh.version", NV_NOFREE
, (char*)(&e_version
[10]),
90 ".sh.dollar", 0, (char*)0,
91 ".sh.match", 0, (char*)0,
92 ".sh.command", 0, (char*)0,
93 ".sh.file", 0, (char*)0,
94 ".sh.fun", 0, (char*)0,
95 ".sh.subshell", NV_INTEGER
|NV_SHORT
|NV_NOFREE
, (char*)0,
96 ".sh.level", 0, (char*)0,
97 ".sh.lineno", NV_INTEGER
|NV_RDONLY
, (char*)0,
98 ".sh.stats", NV_RDONLY
, (char*)0,
99 "SHLVL", NV_INTEGER
|NV_NOFREE
|NV_EXPORT
, (char*)0,
101 "VPATH", 0, (char*)0,
102 #endif /* SHOPT_FS_3D */
104 "CSWIDTH", 0, (char*)0,
105 #endif /* SHOPT_MULTIBYTE */
107 "SYSTYPE", 0, (char*)0,
112 const char *nv_discnames
[] = { "get", "set", "append", "unset", "getn", 0 };
115 const Shtable_t shtab_stats
[] =
117 "arg_cachehits", STAT_ARGHITS
,
118 "arg_expands", STAT_ARGEXPAND
,
119 "comsubs", STAT_COMSUB
,
121 "funcalls", STAT_FUNCT
,
123 "linesread", STAT_READS
,
124 "nv_cachehit", STAT_NVHITS
,
125 "nv_opens", STAT_NVOPEN
,
126 "pathsearch", STAT_PATHS
,
127 "posixfuncall", STAT_SVFUNCT
,
128 "simplecmds", STAT_SCMDS
,
129 "spawns", STAT_SPAWN
,
130 "subshell", STAT_SUBSHELL
132 #endif /* SHOPT_STATS */