---
name: "pshconfig"
section: "1p"
platform: "linux"
package: "psh"
version: "1.8-9"
release: "Debian 5.0 (Lenny)"
platforms: ["linux"]
url: "https://new.carta.tech/pshconfig"
---

# pshconfig(1p)

pshconfig - Configuring the Perl Shell How to configure the Perl Shell Perl Shell uses a built-in, unified configuration system. All essential configuration is done by choosing a set of evaluation strategies, using the `"strategy"` builtin, or by setting options, using the `"option"` builtin.\
 **CONFIGURATION OPTIONS** All options marked as (ENV) inherit their settings from the current environment. All options marked as (EARLY) must be set in the pshrc file or earlier to be evaluated. Contains a list of environment variables which should be tied to arrays. The key of the hash is the name of the variable, the value is the delimiter of the list (e.g. ':' in PATH). The default value for array\_exports currently contains PATH, CLASSPATH, LD\_LIBRARY\_PATH, FIGNORE and CDPATH. A list of paths of directories in which the `"cd"` builtin should search for its argument. Defaults to ".". Controls whether the processing loop saves and displays the Perl value  of executing a line of input. Three cases are distinguished: a false value, in which case no results are displayed; a subroutine reference,  in which case the subroutine is called with the results (this may be multiple arguments if the eval returned an array) and should return true to display, false to not; or a true (scalar) value, in which case  any non-undef, non-empty value is displayed.

In addition to displaying the value, it is pushed onto the array determined by `$Psh::result_array`. Note that scalar values are pushed directly onto this array, but array values are pushed by reference.  A list (separated by the path separator) of file endings to ignore when performing TAB completion. No default. The filename **psh** will use to save the command history in from one invocation to the next, if **save\_history** is set.

Default is "*$ENV{HOME}/.${bin}\_history*". The maximum number of lines to save in the history file. Defaults to 50. If set, **psh** will attempt to continue after internal errors. Controls the action of the shell on receipt of an EOF character as the sole input.  If set, the value is the number of consecutive EOF characters typed as the first characters on an input line before bash exits. If the variable exists but does not have a numeric value, the default value is 10. If it does not exist, EOF signifies the end of input to the shell. If set, Perl Shell will try to ignore all segementation faults. Use this at your own risk! A list of directories to search for executables. This is the standard prompt. It may contain a string or a code reference. Please see below for more information. This is the continuation prompt. If set, the shell will display each line again before it executes it. Controls the window title in interactive use. See prompt evaluation for escape codes. If this is true, the command history is saved in file `$Psh::history_file` from one invocation of **psh** to the next. Setting the variable *ps1* to a string will cause that string to be used as the prompt-string. Setting it to a subroutine reference causes the result of running that subroutine to be used each time. For example,

```
  option ps1= sub { $i++; "psh [$i]\$ "; }
```

will cause the prompt to be `"psh [1]$"` followed by `"psh [2]$"`, and so on.

**psh** uses some of the same \`\`prompting variables'' as **bash**. They are accessed by placing a backslash followed by the code in the prompt string, either hard coded, or as returned by the prompt string function. The variables supported are:

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 \\$(command) which is also support by bash.

Custom prompting variables may be added by adding entries to the array *%Psh::prompt\_vars* keyed by the single character code. The entries should be subroutine references that return the replacement string. **psh** makes a number of variables and functions accessible to the user in the `"Psh::"` package for configuration or utility purposes. Their default values are given in parentheses below. If the variable is also marked "\[late\]", then it is undefined at the start of  the *.pshrc* file, but any value given to it during that file will be  used instead of the default setting. The name of the current shell. The command serial number in the currently-executing processing loop. The pid of the process **psh** will currently forward signals to, or 0 if **psh** will handle the signals internally. Usually 0 unless **psh** is waiting for a process in the "foreground". Whether **psh**'s internal debugging output should be produced. If this variable is set to 1, all available debug output will be shown. If this is set to a string to characters, only debug output belonging to the classes signified by the characters will be shown. Debug classes etc. are in **pshdevel** Every Perl expression that **psh** evaluates as part of its read-eval loop is prepended with this string, intended primarily to set the expected package context. The short host name of the machine **psh** is currently running on. This is not a customization variable but a flag which tells wether you are currently in interactive mode (1) or processing a file (0) Set to true if **psh** is the user's login shell. On systems where this does not apply, set to true unless called from another instance of **psh**. The fully qualified host name of the machine **psh** is running on. Controls where the results of Perl evaluations saved via `$Psh::echo`  will go. It may be a reference to an array, or the string name of an array. When `"Psh::Util::which"` is asked to locate a filename in the current PATH, it will only look for filenames which match this regexp. Names that do not match this regexp will automatically come back "not found". Supposed to contain your most used IP numbers, hostnames or URLs. Those will be eligible for TAB completion if you add a command for completion using complete `"-A"` hostname command. `"psh"` will initialize this list with your /etc/hosts file An array of lines to write to the history file when **psh** exits, only filled when the ReadLine module doesn't handle the history file. The default array where **psh** stores away the results of executing lines, as described in `$Psh::echo` above.  The keys of this hash are single characters, and the values are subroutine references that implement the given escape character in prompt strings. (See "PROMPT STRINGS" below.) Copyright (C) 1999-2003 Gregor N. Purdy. All rights reserved. This script is free software. It may be copied or modified according to the same terms as Perl itself.
