Sponsored Content
Top Forums Shell Programming and Scripting Correct Syntax For Calling Shell Script in Perl Module Post 74191 by cbkihong on Wednesday 8th of June 2005 08:59:16 AM
Old 06-08-2005
If $db_connection is just a string containing the DB name/hostname/username/password etc. then it is easy.

system("/path/to/RemoveRpts.sh '$db_connection'");

If it is a filehandle opened by DBI or so, then you can't pass it as a command-line argument. A filehandle is not a string, and can't be passed on the cmdline.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

calling a shell script from perl

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)
Discussion started by: gurukottur
3 Replies

2. Shell Programming and Scripting

Plz correct my syntax of shell script

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)
Discussion started by: girish.batra
2 Replies

3. Shell Programming and Scripting

How to call a shell script from a perl module which uses Filehandle to login

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)
Discussion started by: saikrishna_tung
2 Replies

4. Shell Programming and Scripting

Calling perl script in shell program

How to call a perl script in shell program / shell scripting. PLS HELP ME (2 Replies)
Discussion started by: hravisankar
2 Replies

5. Shell Programming and Scripting

calling perl subroutine from perl expect module

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)
Discussion started by: arun_maffy
5 Replies

6. Shell Programming and Scripting

Syntax error calling TCL script from shell script

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)
Discussion started by: marcoss90
1 Replies

7. Shell Programming and Scripting

Calling perl subroutine from shell script (sh)

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)
Discussion started by: asarunkumar
4 Replies

8. UNIX for Advanced & Expert Users

Calling PERL from a Korn shell script

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)
Discussion started by: mseanowen
2 Replies

9. Shell Programming and Scripting

Calling perl from shell script

I am calling a perl script from shell script. $ cat mah_appln_bkp_oln.ksh #!/bin/ksh . /udb/home/udbappln/.profile . /udb/home/udbappln/sqllib/db2profile Com=/udb/udbappln/utility/systemscripts/currentUMR perl $Com/backup.pl -d dbname --tsm --purgetsmcopies 21 --purgetsmlogs exit 0 ... (1 Reply)
Discussion started by: ilugopal
1 Replies

10. Shell Programming and Scripting

PERL: Calling a sub routine from another module - help!!!

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
Data::Stag::Writer(3pm) 				User Contributed Perl Documentation				   Data::Stag::Writer(3pm)

NAME
Data::Stag::Writer - base class for all Writers SYNOPSIS
# Abstract class - do not use directly package MyOutputter; use base qw(Data::Stag::Writer); sub e_foo { my ($self, $foo) = @_; $self->writef("data1: %s ", $foo->get_data1); return; } DESCRIPTION
base mixin class for all writers INHERITANCE
This inherits from L<Data::Stag::BaseHandler> PUBLIC METHODS - new Title: new Args: [fn str], [fh FILEHANDLE] Return: L<Data::Stag::BaseHandler> Example: $w = MyWriter->new(-fh=>$fh); returns the tree that was built from all uncaught events file Title: file Args: filename str Returns: filename str Example: $handler->file("my_output_file.txt"); Setting this will cause all output to be diverted to this file; the file will be overwritten by default. The filehandle will not be opened unless any events are thrown For more fine-grained control, use $handler->fh() fh Title: fh Args: filehandle FH Returns: filehandle FH Example: $handler->fh(*STDOUT); Gets/Sets the output filehandle for the writer safe_fh Title: safe_fh Type: PROTECTED Args: filehandle FH Returns: filehandle FH Example: $handler->fh(*STDOUT); As fh(), but makes sure that the filehandle is initialized You should use this if you are overriding this class write Title: write Type: PROTECTED Args: message str Returns: Example: $self->write($stag->get_blah); writes output to be used by classes that subclass this one writef Title: writef As write, analagous to printf use_color Usage - Returns - Args - perl v5.10.0 2008-12-23 Data::Stag::Writer(3pm)
All times are GMT -4. The time now is 06:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy