GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  PSHCONFIG (1)

.ds Aq ’

NAME

pshconfig - Configuring the Perl Shell

CONTENTS

SYNOPSIS

How to configure the Perl Shell

DESCRIPTION

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.
o <B>array_exportsB>

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.

o <B>cdpathB> (ENV)

A list of paths of directories in which the cd builtin should search for its argument. Defaults to ..

o <B>echoB>

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.

o <B>fignoreB> (ENV)

A list (separated by the path separator) of file endings to ignore when performing TAB completion. No default.

o <B>history_fileB>

The filename <B>pshB> will use to save the command history in from one invocation to the next, if <B>save_historyB> is set.

Default is "$ENV{HOME}/.${bin}_history".

o <B>histsizeB> (ENV) (EARLY)

The maximum number of lines to save in the history file. Defaults to 50.

o <B>ignoredieB>

If set, <B>pshB> will attempt to continue after internal errors.

o <B>ignoreeofB> (ENV)

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.

o <B>ignoresegfaultB> (EARLY)

If set, Perl Shell will try to ignore all segementation faults. Use this at your own risk!

o <B>pathB> (ENV)

A list of directories to search for executables.

o <B>ps1B> (ENV)

This is the standard prompt. It may contain a string or a code reference. Please see below for more information.

o <B>ps2B> (ENV)

This is the continuation prompt.

o <B>traceB>

If set, the shell will display each line again before it executes it.

o <B>window_titleB>

Controls the window title in interactive use. See prompt evaluation for escape codes.

o <B>save_historyB>

If this is true, the command history is saved in file $Psh::history_file from one invocation of <B>pshB> to the next.

PROMPT STRINGS

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.

<B>pshB> uses some of the same ‘‘prompting variables’’ as <B>bashB>. 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:
d The date in ‘‘Weekday Month Day’’ format
E The escape character
h The short hostname
H The long hostname
n A carriage return and line feed
s The name of the shell
t The current time in HH:MM:SS format
u The username of the current user
w The current working directory
W The basename of the current working directory
# The command number of the current command
$ ‘#’ if the effective UID is zero, else ‘$’
[ ] Used for Term::ReadLine::Gnu to ignore control characters while determining the length of the prompt
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 SCALAR VARIABLES

<B>pshB> 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.
$Psh::bin (the basename of the file <B>pshB> was invoked by) The name of the current shell.
$Psh::cmd The command serial number in the currently-executing processing loop.
$Psh::currently_active (0) The pid of the process <B>pshB> will currently forward signals to, or 0 if <B>pshB> will handle the signals internally. Usually 0 unless <B>pshB> is waiting for a process in the foreground.
$Psh::debugging (the value of the <B>-dB> option or 0) Whether <B>pshB>’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 <B>pshdevelB>
$Psh::eval_preamble (‘‘package main;’’) Every Perl expression that <B>pshB> evaluates as part of its read-eval loop is prepended with this string, intended primarily to set the expected package context.
$Psh::host (the output of ‘‘hostname -s’’) [late] The short host name of the machine <B>pshB> is currently running on.
$Psh::interactive This is not a customization variable but a flag which tells wether you are currently in interactive mode (1) or processing a file (0)
$Psh::login_shell (0) Set to true if <B>pshB> is the user’s login shell. On systems where this does not apply, set to true unless called from another instance of <B>pshB>.
$Psh::longhost (the output of ‘‘hostname’’) [late] The fully qualified host name of the machine <B>pshB> is running on.
$Psh::result_array (’Psh::val’) 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.
$Psh::which_regexp (’^[-a-zA-Z0-9_~+]*$’) 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.

PSH ARRAY VARIABLES

@Psh::Completion::bookmarks ( from /etc/hosts ) 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
@Psh::history An array of lines to write to the history file when <B>pshB> exits, only filled when the ReadLine module doesn’t handle the history file.
@Psh::val The default array where <B>pshB> stores away the results of executing lines, as described in $Psh::echo above.

PSH HASH VARIABLES

%Psh::Prompt::prompt_vars 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

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.

POD ERRORS

Hey! <B>The above document had some coding errors, which are explained below:B>
Around line 120: You forgot a ’=back’ before ’=head1’
Search for    or go to Top of page |  Section 1 |  Main Index


perl v5.20.3 PSHCONFIG (1) 2007-07-06

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.