Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
Shell::EnvImporter::ShUser3Contributed Perl DocumeShell::EnvImporter::Shell(3)

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

SYNOPSIS
	 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();

DESCRIPTION
       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.

METHODS
       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.

AUTHOR
       David Faraldo, <dfaraldo@cpan.org>

COPYRIGHT AND LICENSE
	 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.

perl v5.32.0			  2009-07-03	  Shell::EnvImporter::Shell(3)

NAME | SYNOPSIS | DESCRIPTION | METHODS | AUTHOR | COPYRIGHT AND LICENSE

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=Shell::EnvImporter::Shell&sektion=3&manpath=FreeBSD+12.2-RELEASE+and+Ports>

home | help