<?xml version="1.0" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Libconf::Templates::Shell - Libconf low level template for shell styles config files</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <link rev="made" href="mailto:root@localhost" /> </head> <body style="background-color: white"> <!-- INDEX BEGIN --> <div name="index"> <p><a name="__index__"></a></p> <ul> <li><a href="#name">NAME</a></li> <li><a href="#description">DESCRIPTION</a></li> <li><a href="#synopsis">SYNOPSIS</a></li> <li><a href="#constructor">CONSTRUCTOR</a></li> <li><a href="#general_methods">GENERAL METHODS</a></li> <li><a href="#specific_methods">SPECIFIC METHODS</a></li> </ul> <hr name="index" /> </div> <!-- INDEX END --> <p> </p> <h1><a name="name">NAME</a></h1> <p>Libconf::Templates::Shell - Libconf low level template for shell styles config files</p> <p> </p> <hr /> <h1><a name="description">DESCRIPTION</a></h1> <p>Libconf::Templates::Shell is a template that handles the files that contain 'shell like' informations.</p> <p> </p> <hr /> <h1><a name="synopsis">SYNOPSIS</a></h1> <pre> my $template = new Libconf::Templates::Shell({ filename => 'some_file' }); $template->read_conf(); ... (see L<Libconf::Templates> for transformation methods on $template) ... $template_write_conf();</pre> <p> </p> <hr /> <h1><a name="constructor">CONSTRUCTOR</a></h1> <dl> <dt><strong><a name="new" class="item"><strong>new($options)</strong></a></strong></dt> <dd> <p>creates the template</p> <pre> $template = new Libconf::Templates::Shell({ filename => 'some_file', }) $template = new Libconf::Templates::Shell({ filename => 'some_file', shell_style => 'true_bash', shell_command => '/bin/bash', export_line => 1, export_only_defined => 1, })</pre> <p><strong>arguments</strong></p> <p>$options [<strong>type</strong> : HASH_REF] specifies the options to create the new template instance.</p> <p><strong>options</strong></p> <p>filename [<strong>type</strong> : STRING, <strong>default</strong> : ''] : the filename of the config file you want to work on. Can be read and written lately by using set_filename and get_filename.</p> <p>shell_style [<strong>type</strong> : STRING, <strong>default</strong> : 'sh', <strong>values</strong>: 'sh', 'csh','true_bash'] : specifies the shell type syntax to use. If 'sh' is used, the key=value is used, if 'csh' is used, the setenv key value is used. An example to transform a sh style config file to a csh one :</p> <pre> my $template = new Libconf::Templates::Shell({ filename => 'some_file' }); $template->read_conf(); $template->{shell_style} = 'csh'; $template_write_conf();</pre> <p>If 'true_bash' is used, then the template will call the shell binary to interpret the values. If 'true_bash' is set, then 'shell_command' has to be set also</p> <p>shell_command [<strong>type</strong> : STRING] : required if shell_style is set to true_bash. This will be used to call the shell binary. Examples : shell_command => '/bin/bash'. It will be used to interpret the values. It is useful when the values uses special bash command (like variable evaluation)</p> <p>export_line [<strong>type</strong> : BOOLEAN, <strong>default</strong> : 0 ] : if true, and if applicable (shell_style = sh), a line will be added at the beginning of the file to export the defined variables in the file, like :</p> <pre> export http_proxy ftp_proxy</pre> <p>export_only_defined [<strong>type</strong> : BOOLEAN, <strong>default</strong> : 1 ] : if true, and if export_line is true, the added line will export only non void variables. If false, the added line will export all variables, even if they are void.</p> </dd> </dl> <p> </p> <hr /> <h1><a name="general_methods">GENERAL METHODS</a></h1> <p>See <a href="./Libconf/Templates.html">the Libconf::Templates manpage</a> for the complete list of methods you can call on this template.</p> <p> </p> <hr /> <h1><a name="specific_methods">SPECIFIC METHODS</a></h1> <p>There is no specific method</p> </body> </html>