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
Shell::EnvImporter::Shell(3) User Contributed Perl Documentation Shell::EnvImporter::Shell(3)

package Shell::EnvImporter::Shell - Shell abstraction for Shell::EnvImporter

  use Shell::EnvImporter;

  # Have Shell::EnvImporter create the shell object
  my $sourcer  = Shell::EnvImporter->new(
                   command  => $command,
                   shell    => $shellname,
                   auto_run => 0,
                 );

  # Fetch the shell object
  my $shellobj = $sourcer->shellobj;

  # Set the shell invocation flags
  $shellobj->flags($flags);

  # Set an alternative 'env' command
  $shellobj->envcmd($envcmd);


  # Manipulate the ignore list:

  # - set
  $shellobj->ignore(qw(_ PWD SHLVL));  

  # - add to
  $shellobj->ignore_push(qw(HOME));  

  # - clear
  $shellobj->ignore_clear();


  # Run the command with the modified shell
  $sourcer->run();

Shell::EnvImporter allows you to import environment variable changes exported by an external script or command into the current environment. The Shell::EnvImporter::Shell object provides more control over interaction with the shell.

flags()
flags(@flags)
flags_push(@flags)
Get or set the flags passed to the shell. E.g. default Bash flags are '-norc -noprofile -c', to prevent the sourcing of startup scripts. Note: If you set the flags, you MUST include the '-c' flag (or equivalent) for passing commands to the shell on the command line.
envcmd()
envcmd($command)
Get or set the command used to print out the environment. E.g., under the Bourne shell and variants, the default command is 'env'. Since 'env' only prints exported environment variables, you can change the command to 'set' to see all shell environment variables, exported or not.
ignore()
ignore(@variables)
ignore_push(@variables)
ignore_clear()
Get, set, append to, or clear the shell ignore list. The shell ignore list is a list of variables that are never imported. These are generally variables that are changed automatically by the shell (e.g. SHLVL and PWD), providing little information to a noninteractive shell.

David Faraldo, <dfaraldo@cpan.org>

  Copyright (C) 2005-2006 by Dave Faraldo

  This library is free software; you can redistribute it and/or modify it
  under the same terms as Perl itself.  No warranty is expressed or implied.
2009-07-03 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

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