Name : perl-Shell-Config-Generate
| |
Version : 0.340.0
| Vendor : obs://build_opensuse_org/devel:languages:perl
|
Release : 150500.1.1
| Date : 2024-07-28 22:57:02
|
Group : Unspecified
| Source RPM : perl-Shell-Config-Generate-0.340.0-150500.1.1.src.rpm
|
Size : 0.06 MB
| |
Packager : https://www_suse_com/
| |
Summary : Portably generate config for any shell
|
Description :
This module provides an interface for specifying shell configurations for different shell environments without having to worry about the arcane differences between shells such as csh, sh, cmd.exe and command.com.
It does not modify the current environment, but it can be used to create shell configurations which do modify the environment.
This module uses Shell::Guess to represent the different types of shells that are supported. In this way you can statically specify just one or more shells:
use Shell::Guess; use Shell::Config::Generate; my $config = Shell::Config::Generate->new; $config->generate_file(Shell::Guess->bourne_shell, \'foo.sh\' ); $config->generate_file(Shell::Guess->c_shell, \'foo.csh\'); $config->generate_file(Shell::Guess->cmd_shell, \'foo.cmd\'); $config->generate_file(Shell::Guess->command_shell, \'foo.bat\');
This will create foo.sh and foo.csh versions of the configurations, which can be sourced like so:
. ./foo.sh
or
source foo.csh
It also creates \'.cmd\' and \'.bat\' files with the same configuration which can be used in Windows. The configuration can be imported back into your shell by simply executing these files:
C:\\> foo.cmd
or
C:\\> foo.bat
Alternatively you can use the shell that called your Perl script using Shell::Guess\'s \'running_shell\' method, and write the output to standard out.
use Shell::Guess; use Shell::Config::Generate; my $config = Shell::Config::Generate->new; print $config->generate(Shell::Guess->running_shell);
If you use this pattern, you can eval the output of your script using your shell\'s back ticks to import the configuration into the shell.
eval `script.pl`
or
eval `script.pl`
|
RPM found in directory: /packages/linux-pbone/ftp5.gwdg.de/pub/opensuse/repositories/devel:/languages:/perl/SLE_15_SP5/noarch |