Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | .\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13 |
2 | .\" | |
3 | .\" Standard preamble: | |
4 | .\" ======================================================================== | |
5 | .de Sh \" Subsection heading | |
6 | .br | |
7 | .if t .Sp | |
8 | .ne 5 | |
9 | .PP | |
10 | \fB\\$1\fR | |
11 | .PP | |
12 | .. | |
13 | .de Sp \" Vertical space (when we can't use .PP) | |
14 | .if t .sp .5v | |
15 | .if n .sp | |
16 | .. | |
17 | .de Vb \" Begin verbatim text | |
18 | .ft CW | |
19 | .nf | |
20 | .ne \\$1 | |
21 | .. | |
22 | .de Ve \" End verbatim text | |
23 | .ft R | |
24 | .fi | |
25 | .. | |
26 | .\" Set up some character translations and predefined strings. \*(-- will | |
27 | .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left | |
28 | .\" double quote, and \*(R" will give a right double quote. | will give a | |
29 | .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to | |
30 | .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' | |
31 | .\" expand to `' in nroff, nothing in troff, for use with C<>. | |
32 | .tr \(*W-|\(bv\*(Tr | |
33 | .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' | |
34 | .ie n \{\ | |
35 | . ds -- \(*W- | |
36 | . ds PI pi | |
37 | . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch | |
38 | . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch | |
39 | . ds L" "" | |
40 | . ds R" "" | |
41 | . ds C` "" | |
42 | . ds C' "" | |
43 | 'br\} | |
44 | .el\{\ | |
45 | . ds -- \|\(em\| | |
46 | . ds PI \(*p | |
47 | . ds L" `` | |
48 | . ds R" '' | |
49 | 'br\} | |
50 | .\" | |
51 | .\" If the F register is turned on, we'll generate index entries on stderr for | |
52 | .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index | |
53 | .\" entries marked with X<> in POD. Of course, you'll have to process the | |
54 | .\" output yourself in some meaningful fashion. | |
55 | .if \nF \{\ | |
56 | . de IX | |
57 | . tm Index:\\$1\t\\n%\t"\\$2" | |
58 | .. | |
59 | . nr % 0 | |
60 | . rr F | |
61 | .\} | |
62 | .\" | |
63 | .\" For nroff, turn off justification. Always turn off hyphenation; it makes | |
64 | .\" way too many mistakes in technical documents. | |
65 | .hy 0 | |
66 | .if n .na | |
67 | .\" | |
68 | .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). | |
69 | .\" Fear. Run. Save yourself. No user-serviceable parts. | |
70 | . \" fudge factors for nroff and troff | |
71 | .if n \{\ | |
72 | . ds #H 0 | |
73 | . ds #V .8m | |
74 | . ds #F .3m | |
75 | . ds #[ \f1 | |
76 | . ds #] \fP | |
77 | .\} | |
78 | .if t \{\ | |
79 | . ds #H ((1u-(\\\\n(.fu%2u))*.13m) | |
80 | . ds #V .6m | |
81 | . ds #F 0 | |
82 | . ds #[ \& | |
83 | . ds #] \& | |
84 | .\} | |
85 | . \" simple accents for nroff and troff | |
86 | .if n \{\ | |
87 | . ds ' \& | |
88 | . ds ` \& | |
89 | . ds ^ \& | |
90 | . ds , \& | |
91 | . ds ~ ~ | |
92 | . ds / | |
93 | .\} | |
94 | .if t \{\ | |
95 | . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" | |
96 | . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' | |
97 | . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' | |
98 | . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' | |
99 | . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' | |
100 | . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' | |
101 | .\} | |
102 | . \" troff and (daisy-wheel) nroff accents | |
103 | .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' | |
104 | .ds 8 \h'\*(#H'\(*b\h'-\*(#H' | |
105 | .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] | |
106 | .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' | |
107 | .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' | |
108 | .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] | |
109 | .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] | |
110 | .ds ae a\h'-(\w'a'u*4/10)'e | |
111 | .ds Ae A\h'-(\w'A'u*4/10)'E | |
112 | . \" corrections for vroff | |
113 | .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' | |
114 | .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' | |
115 | . \" for low resolution devices (crt and lpr) | |
116 | .if \n(.H>23 .if \n(.V>19 \ | |
117 | \{\ | |
118 | . ds : e | |
119 | . ds 8 ss | |
120 | . ds o a | |
121 | . ds d- d\h'-1'\(ga | |
122 | . ds D- D\h'-1'\(hy | |
123 | . ds th \o'bp' | |
124 | . ds Th \o'LP' | |
125 | . ds ae ae | |
126 | . ds Ae AE | |
127 | .\} | |
128 | .rm #[ #] #H #V #F C | |
129 | .\" ======================================================================== | |
130 | .\" | |
131 | .IX Title "PSHCONFIG 1" | |
132 | .TH PSHCONFIG 1 "2003-01-02" "perl v5.8.0" "User Contributed Perl Documentation" | |
133 | .SH "NAME" | |
134 | pshconfig \- Configuring the Perl Shell | |
135 | .SH "SYNOPSIS" | |
136 | .IX Header "SYNOPSIS" | |
137 | How to configure the Perl Shell | |
138 | .SH "DESCRIPTION" | |
139 | .IX Header "DESCRIPTION" | |
140 | Perl Shell uses a built\-in, unified configuration system. All essential | |
141 | configuration is done by choosing a set of evaluation strategies, using | |
142 | the \f(CW\*(C`strategy\*(C'\fR builtin, or by setting options, using the \f(CW\*(C`option\*(C'\fR builtin. | |
143 | .Sh "\s-1CONFIGURATION\s0 \s-1OPTIONS\s0" | |
144 | .IX Subsection "CONFIGURATION OPTIONS" | |
145 | All options marked as (\s-1ENV\s0) inherit their settings from the current | |
146 | environment. | |
147 | .PP | |
148 | All options marked as (\s-1EARLY\s0) must be set in the pshrc file or earlier to | |
149 | be evaluated. | |
150 | .IP "\(bu \fBarray_exports\fR" 4 | |
151 | .IX Item "array_exports" | |
152 | Contains a list of environment variables which should be tied | |
153 | to arrays. The key of the hash is the name of the variable, the | |
154 | value is the delimiter of the list (e.g. ':' in \s-1PATH\s0). The | |
155 | default value for array_exports currently contains \s-1PATH\s0, \s-1CLASSPATH\s0, | |
156 | \&\s-1LD_LIBRARY_PATH\s0, \s-1FIGNORE\s0 and \s-1CDPATH\s0. | |
157 | .IP "\(bu \fBcdpath\fR (\s-1ENV\s0)" 4 | |
158 | .IX Item "cdpath (ENV)" | |
159 | A list of paths of directories in which the \f(CW\*(C`cd\*(C'\fR builtin | |
160 | should search for its argument. Defaults to \*(L".\*(R". | |
161 | .IP "\(bu \fBecho\fR" 4 | |
162 | .IX Item "echo" | |
163 | Controls whether the processing loop saves and displays the Perl value | |
164 | of executing a line of input. Three cases are distinguished: a false | |
165 | value, in which case no results are displayed; a subroutine reference, | |
166 | in which case the subroutine is called with the results (this may be | |
167 | multiple arguments if the eval returned an array) and should return | |
168 | true to display, false to not; or a true (scalar) value, in which case | |
169 | any non\-undef, non-empty value is displayed. | |
170 | .Sp | |
171 | In addition to displaying the value, it is pushed onto the array | |
172 | determined by \f(CW$Psh::result_array\fR. | |
173 | Note that scalar values are pushed directly onto this array, but array | |
174 | values are pushed by reference. | |
175 | .IP "\(bu \fBfignore\fR (\s-1ENV\s0)" 4 | |
176 | .IX Item "fignore (ENV)" | |
177 | A list (separated by the path separator) of file endings to | |
178 | ignore when performing \s-1TAB\s0 completion. No default. | |
179 | .IP "\(bu \fBhistory_file\fR" 4 | |
180 | .IX Item "history_file" | |
181 | The filename \fBpsh\fR will use to save the command history in from one | |
182 | invocation to the next, if \fBsave_history\fR is set. | |
183 | .Sp | |
184 | Default is "\fI$ENV{\s-1HOME\s0}/.${bin}_history\fR". | |
185 | .IP "\(bu \fBhistsize\fR (\s-1ENV\s0) (\s-1EARLY\s0)" 4 | |
186 | .IX Item "histsize (ENV) (EARLY)" | |
187 | The maximum number of lines to save in the history file. | |
188 | Defaults to 50. | |
189 | .IP "\(bu \fBignoredie\fR" 4 | |
190 | .IX Item "ignoredie" | |
191 | If set, \fBpsh\fR will attempt to continue after internal | |
192 | errors. | |
193 | .IP "\(bu \fBignoreeof\fR (\s-1ENV\s0)" 4 | |
194 | .IX Item "ignoreeof (ENV)" | |
195 | Controls the action of the shell on receipt of an \s-1EOF\s0 character as the | |
196 | sole input. If set, the value is the number of consecutive \s-1EOF\s0 characters | |
197 | typed as the first characters on an input line before bash exits. | |
198 | If the variable exists but does not have a numeric value, the default value | |
199 | is 10. If it does not exist, \s-1EOF\s0 signifies the end of input to the shell. | |
200 | .IP "\(bu \fBignoresegfault\fR (\s-1EARLY\s0)" 4 | |
201 | .IX Item "ignoresegfault (EARLY)" | |
202 | If set, Perl Shell will try to ignore all segementation faults. Use this | |
203 | at your own risk! | |
204 | .IP "\(bu \fBpath\fR (\s-1ENV\s0)" 4 | |
205 | .IX Item "path (ENV)" | |
206 | A list of directories to search for executables. | |
207 | .IP "\(bu \fBps1\fR (\s-1ENV\s0)" 4 | |
208 | .IX Item "ps1 (ENV)" | |
209 | This is the standard prompt. It may contain a string or a code reference. | |
210 | Please see below for more information. | |
211 | .IP "\(bu \fBps2\fR (\s-1ENV\s0)" 4 | |
212 | .IX Item "ps2 (ENV)" | |
213 | This is the continuation prompt. | |
214 | .IP "\(bu \fBtrace\fR" 4 | |
215 | .IX Item "trace" | |
216 | If set, the shell will display each line again before it executes it. | |
217 | .IP "\(bu \fBwindow_title\fR" 4 | |
218 | .IX Item "window_title" | |
219 | Controls the window title in interactive use. See prompt evaluation | |
220 | for escape codes. | |
221 | .IP "\(bu \fBsave_history\fR" 4 | |
222 | .IX Item "save_history" | |
223 | If this is true, the command history is saved in file \f(CW$Psh::history_file\fR | |
224 | from one invocation of \fBpsh\fR to the next. | |
225 | .SH "PROMPT STRINGS" | |
226 | .IX Header "PROMPT STRINGS" | |
227 | Setting the variable \fIps1\fR to a string will cause that string | |
228 | to be used as the prompt\-string. Setting it to a subroutine reference | |
229 | causes the result of running that subroutine to be used each time. | |
230 | For example, | |
231 | .Sp | |
232 | .Vb 1 | |
233 | \& option ps1= sub { $i++; "psh [$i]\e$ "; } | |
234 | .Ve | |
235 | .Sp | |
236 | will cause the prompt to be \f(CW\*(C`psh [1]$\*(C'\fR followed by \f(CW\*(C`psh [2]$\*(C'\fR, and so on. | |
237 | .Sp | |
238 | \&\fBpsh\fR uses some of the same ``prompting variables'' as \fBbash\fR. They are | |
239 | accessed by placing a backslash followed by the code in the prompt string, | |
240 | either hard coded, or as returned by the prompt string function. The | |
241 | variables supported are: | |
242 | .RS 4 | |
243 | .IP "d The date in ``Weekday Month Day'' format" 4 | |
244 | .IX Item "d The date in ``Weekday Month Day'' format" | |
245 | .PD 0 | |
246 | .IP "E The escape character" 4 | |
247 | .IX Item "E The escape character" | |
248 | .IP "h The short hostname" 4 | |
249 | .IX Item "h The short hostname" | |
250 | .IP "H The long hostname" 4 | |
251 | .IX Item "H The long hostname" | |
252 | .IP "n A carriage return and line feed" 4 | |
253 | .IX Item "n A carriage return and line feed" | |
254 | .IP "s The name of the shell" 4 | |
255 | .IX Item "s The name of the shell" | |
256 | .IP "t The current time in \s-1HH:MM:SS\s0 format" 4 | |
257 | .IX Item "t The current time in HH:MM:SS format" | |
258 | .IP "u The username of the current user" 4 | |
259 | .IX Item "u The username of the current user" | |
260 | .IP "w The current working directory" 4 | |
261 | .IX Item "w The current working directory" | |
262 | .IP "W The basename of the current working directory" 4 | |
263 | .IX Item "W The basename of the current working directory" | |
264 | .IP "# The command number of the current command" 4 | |
265 | .IX Item "# The command number of the current command" | |
266 | .IP "$ `#' if the effective \s-1UID\s0 is zero, else `$'" 4 | |
267 | .IX Item "$ `#' if the effective UID is zero, else `$'" | |
268 | .IP "[ ] Used for Term::ReadLine::Gnu to ignore control characters while determining the length of the prompt" 4 | |
269 | .IX Item "[ ] Used for Term::ReadLine::Gnu to ignore control characters while determining the length of the prompt" | |
270 | .RE | |
271 | .RS 4 | |
272 | .PD | |
273 | .Sp | |
274 | Please note that bash's support of backticks to execute code from within the prompt is not supported in psh. Instead use the newer syntax \e$(command) which is also support by bash. | |
275 | .Sp | |
276 | Custom prompting variables may be added by adding entries to the array | |
277 | \&\fI%Psh::prompt_vars\fR keyed by the single character code. The entries | |
278 | should be subroutine references that return the replacement string. | |
279 | .SH "PSH SCALAR VARIABLES" | |
280 | .IX Header "PSH SCALAR VARIABLES" | |
281 | \&\fBpsh\fR makes a number of variables and functions accessible to the | |
282 | user in the \f(CW\*(C`Psh::\*(C'\fR package for configuration or utility | |
283 | purposes. Their default values are given in parentheses below. If the | |
284 | variable is also marked \*(L"[late]\*(R", then it is undefined at the start of | |
285 | the \fI.pshrc\fR file, but any value given to it during that file will be | |
286 | used instead of the default setting. | |
287 | .IP "\fI$Psh::bin\fR (the basename of the file \fBpsh\fR was invoked by)" 4 | |
288 | .IX Item "$Psh::bin (the basename of the file psh was invoked by)" | |
289 | The name of the current shell. | |
290 | .IP "\fI$Psh::cmd\fR" 4 | |
291 | .IX Item "$Psh::cmd" | |
292 | The command serial number in the currently-executing processing loop. | |
293 | .IP "\fI$Psh::currently_active\fR (0)" 4 | |
294 | .IX Item "$Psh::currently_active (0)" | |
295 | The pid of the process \fBpsh\fR will currently forward signals to, or 0 | |
296 | if \fBpsh\fR will handle the signals internally. Usually | |
297 | 0 unless \fBpsh\fR is waiting for a process in the \*(L"foreground\*(R". | |
298 | .IP "\fI$Psh::debugging\fR (the value of the \fB\-d\fR option or 0)" 4 | |
299 | .IX Item "$Psh::debugging (the value of the -d option or 0)" | |
300 | Whether \fBpsh\fR's internal debugging output should be produced. If this | |
301 | variable is set to 1, all available debug output will be shown. If | |
302 | this is set to a string to characters, only debug output belonging | |
303 | to the classes signified by the characters will be shown. Debug | |
304 | classes etc. are in \fBpshdevel\fR | |
305 | .ie n .IP "\fI$Psh::eval_preamble\fR (""package main;"")" 4 | |
306 | .el .IP "\fI$Psh::eval_preamble\fR (``package main;'')" 4 | |
307 | .IX Item "$Psh::eval_preamble (package main;)" | |
308 | Every Perl expression that \fBpsh\fR evaluates as part of its read-eval loop | |
309 | is prepended with this string, intended primarily to set the expected | |
310 | package context. | |
311 | .ie n .IP "\fI$Psh::host\fR (the output of """"hostname \-s"""") [late]" 4 | |
312 | .el .IP "\fI$Psh::host\fR (the output of ``\f(CWhostname \-s\fR'') [late]" 4 | |
313 | .IX Item "$Psh::host (the output of ""hostname -s"") [late]" | |
314 | The short host name of the machine \fBpsh\fR is currently running on. | |
315 | .IP "\fI$Psh::interactive\fR" 4 | |
316 | .IX Item "$Psh::interactive" | |
317 | This is not a customization variable but a flag which tells wether | |
318 | you are currently in interactive mode (1) or processing a file (0) | |
319 | .IP "\fI$Psh::login_shell\fR (0)" 4 | |
320 | .IX Item "$Psh::login_shell (0)" | |
321 | Set to true if \fBpsh\fR is the user's login shell. On systems where this | |
322 | does not apply, set to true unless called from another instance of \fBpsh\fR. | |
323 | .ie n .IP "\fI$Psh::longhost\fR (the output of """"hostname"""") [late]" 4 | |
324 | .el .IP "\fI$Psh::longhost\fR (the output of ``\f(CWhostname\fR'') [late]" 4 | |
325 | .IX Item "$Psh::longhost (the output of ""hostname"") [late]" | |
326 | The fully qualified host name of the machine \fBpsh\fR is running on. | |
327 | .IP "\fI$Psh::result_array\fR ('Psh::val')" 4 | |
328 | .IX Item "$Psh::result_array ('Psh::val')" | |
329 | Controls where the results of Perl evaluations saved via \f(CW$Psh::echo\fR | |
330 | will go. It may be a reference to an array, or the string name of an | |
331 | array. | |
332 | .IP "\fI$Psh::which_regexp\fR ('^[\-a\-zA\-Z0\-9_~+]*$')" 4 | |
333 | .IX Item "$Psh::which_regexp ('^[-a-zA-Z0-9_~+]*$')" | |
334 | When \f(CW\*(C`Psh::Util::which\*(C'\fR is asked to locate a filename in the current | |
335 | \&\s-1PATH\s0, it will only look for filenames which match this regexp. Names | |
336 | that do not match this regexp will automatically come back \*(L"not found\*(R". | |
337 | .RE | |
338 | .RS 4 | |
339 | .SH "PSH ARRAY VARIABLES" | |
340 | .IX Header "PSH ARRAY VARIABLES" | |
341 | .IP "\fI@Psh::Completion::bookmarks\fR ( from /etc/hosts )" 4 | |
342 | .IX Item "@Psh::Completion::bookmarks ( from /etc/hosts )" | |
343 | Supposed to contain your most used \s-1IP\s0 numbers, hostnames or URLs. | |
344 | Those will be eligible for \s-1TAB\s0 completion if you add a command | |
345 | for completion using complete \f(CW\*(C`\-A\*(C'\fR hostname command. \f(CW\*(C`psh\*(C'\fR will | |
346 | initialize this list with your /etc/hosts file | |
347 | .IP "\fI@Psh::history\fR" 4 | |
348 | .IX Item "@Psh::history" | |
349 | An array of lines to write to the history file when \fBpsh\fR exits, only | |
350 | filled when the ReadLine module doesn't handle the history file. | |
351 | .IP "\fI@Psh::val\fR" 4 | |
352 | .IX Item "@Psh::val" | |
353 | The default array where \fBpsh\fR stores away the results of executing | |
354 | lines, as described in \f(CW$Psh::echo\fR above. | |
355 | .RE | |
356 | .RS 4 | |
357 | .SH "PSH HASH VARIABLES" | |
358 | .IX Header "PSH HASH VARIABLES" | |
359 | .IP "\fI%Psh::Prompt::prompt_vars\fR" 4 | |
360 | .IX Item "%Psh::Prompt::prompt_vars" | |
361 | The keys of this hash are single characters, and the values are | |
362 | subroutine references that implement the given escape character in | |
363 | prompt strings. (See \*(L"\s-1PROMPT\s0 \s-1STRINGS\s0\*(R" below.) | |
364 | .RE | |
365 | .RS 4 | |
366 | .SH "COPYRIGHT" | |
367 | .IX Header "COPYRIGHT" | |
368 | Copyright (C) 1999\-2003 Gregor N. Purdy. All rights reserved. | |
369 | This script is free software. It may be copied or modified according | |
370 | to the same terms as Perl itself. |