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
FileCache(3pm)						 Perl Programmers Reference Guide					    FileCache(3pm)

NAME
FileCache - keep more files open than the system permits SYNOPSIS
no strict 'refs'; use FileCache; # or use FileCache maxopen => 16; cacheout $mode, $path; # or cacheout $path; print $path @data; $fh = cacheout $mode, $path; # or $fh = cacheout $path; print $fh @data; DESCRIPTION
The "cacheout" function will make sure that there's a filehandle open for reading or writing available as the pathname you give it. It automatically closes and re-opens files if you exceed your system's maximum number of file descriptors, or the suggested maximum maxopen. cacheout EXPR The 1-argument form of cacheout will open a file for writing ('>') on it's first use, and appending ('>>') thereafter. Returns EXPR on success for convenience. You may neglect the return value and manipulate EXPR as the filehandle directly if you prefer. cacheout MODE, EXPR The 2-argument form of cacheout will use the supplied mode for the initial and subsequent openings. Most valid modes for 3-argument "open" are supported namely; '>', '+>', '<', '<+', '>>', '|-' and '-|' To pass supplemental arguments to a program opened with '|-' or '-|' append them to the command string as you would system EXPR. Returns EXPR on success for convenience. You may neglect the return value and manipulate EXPR as the filehandle directly if you prefer. CAVEATS
While it is permissible to "close" a FileCache managed file, do not do so if you are calling "FileCache::cacheout" from a package other than which it was imported, or with another module which overrides "close". If you must, use "FileCache::cacheout_close". Although FileCache can be used with piped opens ('-|' or '|-') doing so is strongly discouraged. If FileCache finds it necessary to close and then reopen a pipe, the command at the far end of the pipe will be reexecuted - the results of performing IO on FileCache'd pipes is unlikely to be what you expect. The ability to use FileCache on pipes may be removed in a future release. FileCache does not store the current file offset if it finds it necessary to close a file. When the file is reopened, the offset will be as specified by the original "open" file mode. This could be construed to be a bug. The module functionality relies on symbolic references, so things will break under 'use strict' unless 'no strict "refs"' is also specified. BUGS
sys/param.h lies with its "NOFILE" define on some systems, so you may have to set maxopen yourself. perl v5.18.2 2014-01-06 FileCache(3pm)
All times are GMT -4. The time now is 05:23 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy