- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Script which calls another perl script
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2003 09:26 AM
01-24-2003 09:26 AM
Could someone guide me on "how to pass on a variable' value to the called in script which is written in perl", where the calling i.e; the parent script is standard Unix Posix shell.
I'm using the Net /FTP functionality in Perl for my scripting. So from my parent Unix script, i will gather the list of files to be trasferred, and that list will be handed over to the Perl script one by one, using which I would have better error code trappings or so.
Thanks in advance.
Cheers !!!
Mathew.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2003 09:40 AM
01-24-2003 09:40 AM
Re: Script which calls another perl script
Good Luck.
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2003 09:45 AM
01-24-2003 09:45 AM
Re: Script which calls another perl script
it is a perl script.
You can process as many arguments seperated by spaces as you need by modifying this script.
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2003 09:47 AM
01-24-2003 09:47 AM
Re: Script which calls another perl script
Tom asked the same, and got the right answers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2003 09:48 AM
01-24-2003 09:48 AM
SolutionThis should serve as an example:
ftpget.pl file1 file1 file3
See the attached Perl script.
------------------------
Another useful technique is getopts:
use Getopt::Std;
use English;
use strict;
our ($opt_m,$opt_a,$opt_c,$opt_e);
my $mode = 0;
my $knt = 0;
my $epoch = 0;
getopts('mace:');
if (defined($opt_e))
{
$epoch = $opt_e;
++$knt;
}
if (defined($opt_m))
{
$mode = 0;
++$knt;
}
if (defined($opt_a))
{
$mode = 1;
++$knt;
}
if (defined($opt_c))
{
$mode = 2;
++$knt;
}
Note that the 'e' arg is followed by a colon and thus expect a value (-e 45) to be supplied while the others simply expect to be found (or not).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2003 10:03 AM
01-24-2003 10:03 AM
Re: Script which calls another perl script
use strict;
use warnings;
use Getopt::Long qw(:config bundling nopermute);
my $mode = 0;
my $epoch = 0;
GetOptions (
"e:i" => \$epoch,
"m" => sub { $mode = 0 },
"a" => sub { $mode = 1 },
"c" => sub { $mode = 2 },
} or die "bad option";
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2003 10:04 AM
01-24-2003 10:04 AM
Re: Script which calls another perl script
use strict;
use warnings;
use Getopt::Long qw(:config bundling nopermute);
my $mode = 0;
my $epoch = 0;
GetOptions (
"e:i" => \$epoch,
"m" => sub { $mode = 0 },
"a" => sub { $mode = 1 },
"c" => sub { $mode = 2 },
} or die "bad option";