NAME
pvswitch - transparently switch between multiple program versionsSYNOPSIS
pvswitchprogram [args]
programver [version]
DESCRIPTION
pvswitch allows an easy switch between multiple installed versions of the same program. The version can be selected by an environment variable, so that multiple session can use different versions without the need to change the call to the program. This is typically used for interpreter languages like perl, tcl, python which are selected via a hash-bang line (#!). For such scripts pvswitch allows you to switch the version without changing the script.The pvswitch syntax runs pvswitch in test mode, it will just parse the config files and report errors.
The program syntax is used to run the program under control of pvswitch. program is a placeholder for the program you want to manage, e.g. perl. To make this work you will need to replace your primary perl binary with a symlink to pvswitch (see INSTALLATION below).
The programver syntax can be used to change the version of program you want to use (see INSTALLATION below).
INSTALLATION
pvswitch needs three configurations to operate. Please see the INSTALL file included in the distribution for a step-by-step installation guideline.
- 1
- The configuration file /usr/local/etc/pvswitch.conf which defines the available versions for each program
- 2
-
An symbolic link so that
pvswitch
is executed instead of program you want to manage.
pvswitch
uses the name of the program being executed (argv[0]) to obtain
the program name which is to be executed.
Additionally you might want a second symlink which is the program name prefixed by 'ver'. This is used to configure the PVSWITCH_<PROGRAM>_VERSION environment variable.
Those symlinks are usually created during installation with the pvconfig program.
- 3
-
The environment variable PVSWITCH_<PROGRAM>_VERSION
(where PROGRAM is the name of the program to execute argv[0])
to select the version to use for this program.
If this setting is missing, it defaults to the first configured version in the config file.
This is usually managed by an alias which executes pvswitch through the programver symlink.
If you call pvswitch directly (normally you call it via a symlink) pvswitch will parse its configuration file and report errors.
FILES
/usr/local/etc/pvswitch.conf The configuration file for pvswitchAUTHOR
Copyright (c) 2004 by Markus Winand <>SEE ALSO
pvswitch.conf(5)