The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Psh::Builtins - package for Psh builtins, possibly loading them as needed

SYNOPSIS

  use Psh::Builtins;

DESCRIPTION

Psh::Builtins currently contains only the hardcoded builtins of Perl Shell, but may later on be extended to load them on the fly from separate modules.

Builtins

  • setenv NAME [=] VALUE

    Sets the environment variable NAME to VALUE.

  • export VAR [=VALUE]

    Just like setenv, below, except that it also ties the variable (in the Perl sense) so that subsequent changes to the variable automatically affect the environment. Variables who are lists and appear in %Psh::array_exports will also by tied to the array of the same name. Note that the variable must be specified without any Perl specifier like $ or @.

  • cd DIR

    Change the working directory to DIR or $ENV{HOME} if DIR is not specified. The special DIR "-" is interpreted as "return to the previous directory".

  • kill [SIGNAL] [%JOB | PID] | -l

    Send SIGNAL (which defaults to TERM) to the given process, specified either as a job (%NN) or as a pid (a number).

  • which COMMAND-LINE

    Describe how psh will execute the given COMMAND-LINE, under the current setting of $Psh::strategies.

  • alias [NAME [=] REPLACEMENT]

    Add NAME as a built-in so that NAME <REST_OF_LINE> will execute exactly as if REPLACEMENT <REST_OF_LINE> had been entered. For example, one can execute alias ls ls -F to always supply the -F option to "ls". Note the built-in is defined to avoid recursion here.

    With no arguments, prints out a list of the current aliases. With only the NAME argument, prints out a definition of the alias with that name.

  • unalias NAME | -a | all]

    Removes the alias with name <NAME or all aliases if either <-a (for bash compatibility) or <all is specified.

  • fg JOB

    Bring a job into the foreground. If JOB is omitted, uses the highest-numbered stopped job, or, failing that, the highest-numbered job. JOB may either be a job number or a word that occurs in the command used to create the job.

  • bg [JOB]

    Put a job into the background. If JOB is omitted, uses the highest-numbered stopped job, if any.

  • jobs

    List the currently running jobs.

  • exit

    Exit out of the shell.

  • source FILE [or . FILE]

    Read and process the contents of the given file as a sequence of psh commands.

  • readline

    Prints out information about the current ReadLine module which is being used for command line input. Very rudimentary at present, should be extended to allow rebinding, etc.

  • help [COMMAND]

    If COMMAND is specified, print out help on it; otherwise print out a list of psh builtins.

  • builtin COMMAND [ARGS]

    Run a shell builtin.

AUTHOR

the Psh team

SEE ALSO

psh