As you can see, you have to go the extra mile to achieve what you intended, and the eval has some caveats tagged to it. In recents shells, this could be done way easier using arrays:
Is there any restriction on number of parameters can be passed on to the shell script?
I found, after 9th parameter for parameter 10, it is taking parameter 1. (1 Reply)
hi all,
i have a ksh script that takes up to 3 parameters -- only 2 of which are required. what's the simplest way to check if the user passed 2 or 3 parameters?
if 3 parameters are not null then
do this
elif 2 parameters are not null then
do this
else
echo "you need at least 2... (5 Replies)
Hello gurus,
I have three korn shell script 3.1, 3.2, 3.3. I would like to call three shell script in one shell script.
i m looking for something like this
call 3.1;
If 3.1 = "complete" then
call 3.2;
if 3.2 = ''COMPlete" then
call 3.3;
else
exit
The... (1 Reply)
Hi,
I need a script that will run a dynamic Oracle SQL. Dynamic meaning the SQL statement depends on the parameter.
For instance, something like this:
#!/bin/ksh -x
# Set environment
. /home/mine/set_vars
sqlplus $LOGINID <<! >> /home/mine/log.txt
select count(1) from $1
where... (2 Replies)
Hello,
I'm a newbie in shell script.
So, i would like to create a shell script which take 2 IN parameters (PARAM1 and PARAM2).
This script need to create 2 files as :
I need to create this file /etc/apache2/sites-available/PARAM2 :
<VirtualHost *:80>
DocumentRoot "/home/PARAM1/www"... (0 Replies)
this is my issue.
4 parameters are passed from korn shell to sql script.
parameter_1= varchar2 datatype or no value entered my user.
parameter_2= number datatype or no value entered my user.
parameter_3= number datatype or no value entered my user.
parameter_4= number datatype or no... (5 Replies)
Hi Experts,
I have been trying to work on a simple shell script that will just add the two argument passed to it. Here is what i tried :
#!/bin/bash
welcome(){
echo "Welcome to this Progg. which will accept two parameter"
}
main_logic(){
arg=$#
echo "Number of argument passed is... (4 Replies)
Discussion started by: mukulverma2408
4 Replies
LEARN ABOUT DEBIAN
inn::config
INN::Config(3pm) InterNetNews Documentation INN::Config(3pm)NAME
INN::Config - Export all the variables an INN Perl script might need
DESCRIPTION
This Perl module sets up any and all the variables that an INN Perl script might need. More particularly, it allows to use inn.conf
variables: they are all provided by innconfval, as well as the version of INN (in the variable $INN::Config::VERSION for its short number
form, on in $INN::Config::version for its complete form). Other useful variables are also provided (directories, files, programs, masks,
parameters). The complete list can be obtained with the following script that prints them out:
use lib '<pathnews>/lib/perl';
use INN::Config;
use Data::Dumper;
my ($varname, $value);
foreach my $var (@INN::Config::EXPORT_OK) {
if ($var =~ /^$(.*)$/) {
$varname = "INN::Config::$1";
$value = Dumper($$varname);
$value =~ s/^$VAR1 = //;
print "$$varname = $value";
} elsif ($var =~ /^@(.*)$/) {
$varname = "INN::Config::$1";
$value = Dumper(@$varname);
$value =~ s/^$VAR1 = //;
print "@$varname = $value";
}
}
A local Perl script named innshellvars.pl.local in pathetc will be loaded, if present and executable, at the end of the run of this module.
A typical use is to add or override variables.
You only have to declare the module at the beginning of them:
use lib '<pathnews>/lib/perl';
use INN::Config;
Then, you can for instance use:
print $INN::Config::localmaxartsize;
to print the value of localmaxartsize as it is set in inn.conf.
You can also specify a version when you import the module. If you write:
use INN::Config 2.5.0;
only versions of INN superior to 2.5.0 will be able to run the Perl script.
It is also possible to import the variables directly in your namespace if you specify what you want to import:
use INN::Config qw($localmaxartsize $pathbin);
Note that a legacy innshellvars.pl is also provided in pathnews/lib for compatibility reasons with old Perl scripts not shipped with INN.
It was used by versions of INN anterior to 2.5.0. The corresponding scripts for Shell and Tcl are, however, still in use: innshellvars
and innshellvars.tcl. They offer the same capabilities as this module.
HISTORY
innshellvars.pl was written by James Brister <brister@vix.com> for InterNetNews in 1996. It was converted to the INN::Config Perl module
by Julien Elie in 2007.
$Id: Config.pm.in 9311 2011-08-06 20:18:42Z iulius $
SEE ALSO inn.conf(5), innconfval(1), perl(1).
INN 2.5.3 2011-08-22 INN::Config(3pm)