Call sh script RemoveRpts.sh and pass variable $db_connection
Maybe i didn't understand what you mean, but to me this looks simple: "$db_connection" is some sort of handle, id, ... - basically, it is something that fits into a variable.
Code:
RemoveRpts.sh $db_connection
will call a script RemoveRpts.sh and provide it with the content of this variable. Inside the script you can expand the first parameter by using "$1". Therefore the script could look like:
Code:
#!/bin/ksh
typeset db_connection=""
if [ -n "$1" ] ; then
print - "Error: no database connection passed."
exit 1
else
db_connection="$1"
fi
# ... your code goes here
exit 0
Hi all,
Not sure if this is the right forum to post query regarding perl script.
I have a perl script which internally calls a shell script. My problem is that the shell script should be passed command line arguments.
I call a shell script from perl using:
system("sript.sh");
How do... (3 Replies)
Dear all
I am still bit new in shell script area.I am writing down a shell script which I guess somewhere wrong so please kindly correct it. I would be greatful for that.
What I actually want from this shell script is that it will move all the files one by one to another server which can be... (2 Replies)
Hi Guru's,
Pardon me for the breach of rules.....
I have very little knowledge about Shell Programming and Scripting hope you guys help me out of this troble
I have very little time hence could not find the right way to direct my queries.
coming to the problem
I need to call a... (2 Replies)
All,
Is it possible to call a subroutine from the perl expect module after logging to a system that is within the same program. My situation is I need to run a logic inside a machine that I'm logging in using the expect module, the logic is also available in the same expect program.
Thanks,... (5 Replies)
hello everyone
i am beginner on shell scripting .and i am working on my project work on ad hoc network
i wrote a batch (.sh) to do a looping and execute a tcl script i wrote before in each iteration ..but i got this problem "
syntax error near unexpected token `('... (1 Reply)
Hi,
ive a perl script, where it has a subroutine clear() in it, and i've one shell script which runs in background, from that shell script i wanted to call subroutine which is in perl script, that's perl script is not module, just simple script.
Eg:
perl script <test>
#!... (4 Replies)
I am currently in Afghanistan and do not have access to some of the resources I normally do back in the US. Just accessed this site and it looks promising! Hopefully you will not find my question too much of a waste of your time.
I write mostly Korn Shell and PERL on Solaris systems for the... (2 Replies)
Hi,
I am an occasional PERL user. I am trying to call a sub routine (passing parameters) in perl module from a driver .pl file. I have been "tinkering" for a while now and have confused myself.
Could someone please look at the code below and spot where I am going wrong.
testPerl.pl
... (0 Replies)
Discussion started by: chris01010
0 Replies
LEARN ABOUT MOJAVE
cpanplus5.18
CPANPLUS(3pm) Perl Programmers Reference Guide CPANPLUS(3pm)NAME
CPANPLUS - API & CLI access to the CPAN mirrors
SYNOPSIS
### standard invocation from the command line
$ cpanp
$ cpanp -i Some::Module
$ perl -MCPANPLUS -eshell
$ perl -MCPANPLUS -e'fetch Some::Module'
DESCRIPTION
The "CPANPLUS" library is an API to the "CPAN" mirrors and a collection of interactive shells, commandline programs, etc, that use this
API.
GUIDE TO DOCUMENTATION
GENERAL USAGE
This is the document you are currently reading. It describes basic usage and background information. Its main purpose is to assist the user
who wants to learn how to invoke CPANPLUS and install modules from the commandline and to point you to more indepth reading if required.
API REFERENCE
The "CPANPLUS" API is meant to let you programmatically interact with the "CPAN" mirrors. The documentation in CPANPLUS::Backend shows you
how to create an object capable of interacting with those mirrors, letting you create & retrieve module objects. CPANPLUS::Module shows
you how you can use these module objects to perform actions like installing and testing.
The default shell, documented in CPANPLUS::Shell::Default is also scriptable. You can use its API to dispatch calls from your script to the
CPANPLUS Shell.
COMMANDLINE TOOLS
STARTING AN INTERACTIVE SHELL
You can start an interactive shell by running either of the two following commands:
$ cpanp
$ perl -MCPANPLUS -eshell
All commands available are listed in the interactive shells help menu. See "cpanp -h" or CPANPLUS::Shell::Default for instructions on using
the default shell.
CHOOSE A SHELL
By running "cpanp" without arguments, you will start up the shell specified in your config, which defaults to CPANPLUS::Shell::Default.
There are more shells available. "CPANPLUS" itself ships with an emulation shell called CPANPLUS::Shell::Classic that looks and feels just
like the old "CPAN.pm" shell.
You can start this shell by typing:
$ perl -MCPANPLUS -e'shell Classic'
Even more shells may be available from "CPAN".
Note that if you have changed your default shell in your configuration, that shell will be used instead. If for some reason there was an
error with your specified shell, you will be given the default shell.
BUILDING PACKAGES
"cpan2dist" is a commandline tool to convert any distribution from "CPAN" into a package in the format of your choice, like for example
".deb" or "FreeBSD ports".
See "cpan2dist -h" for details.
FUNCTIONS
For quick access to common commands, you may use this module, "CPANPLUS" rather than the full programmatic API situated in
"CPANPLUS::Backend". This module offers the following functions:
$bool = install( Module::Name | /A/AU/AUTHOR/Module-Name-1.tgz )
This function requires the full name of the module, which is case sensitive. The module name can also be provided as a fully qualified
file name, beginning with a /, relative to the /authors/id directory on a CPAN mirror.
It will download, extract and install the module.
$where = fetch( Module::Name | /A/AU/AUTHOR/Module-Name-1.tgz )
Like install, fetch needs the full name of a module or the fully qualified file name, and is case sensitive.
It will download the specified module to the current directory.
$where = get( Module::Name | /A/AU/AUTHOR/Module-Name-1.tgz )
Get is provided as an alias for fetch for compatibility with CPAN.pm.
shell()
Shell starts the default CPAN shell. You can also start the shell by using the "cpanp" command, which will be installed in your perl bin.
FAQ
For frequently asked questions and answers, please consult the "CPANPLUS::FAQ" manual.
BUG REPORTS
Please report bugs or other issues to <bug-cpanplus@rt.cpan.org<gt>.
AUTHOR
This module by Jos Boumans <kane@cpan.org>.
COPYRIGHT
The CPAN++ interface (of which this module is a part of) is copyright (c) 2001 - 2007, Jos Boumans <kane@cpan.org>. All rights reserved.
This library is free software; you may redistribute and/or modify it under the same terms as Perl itself.
SEE ALSO
CPANPLUS::Shell::Default, CPANPLUS::FAQ, CPANPLUS::Backend, CPANPLUS::Module, cpanp, cpan2dist
CONTACT INFORMATION
o Bug reporting: bug-cpanplus@rt.cpan.org
o Questions & suggestions: bug-cpanplus@rt.cpan.org
perl v5.18.2 2014-01-06 CPANPLUS(3pm)