03-03-2018
The solution to my question is the command
do EXPR;
, having as EXPR the script-2!
That way the script-2 will have defined in script-1 some variables;
it will process everything, printing on STDOUT what it should print (the script-2), and
it will set any variable that will be available in the script-1 after completing the script-2.
After finishing the script-2 control coming back to script-1
That is all I been looking for!
(Hmm, after review my question, surprizingly realizing that I have used the 'do ..'
How it happening that I have mislead myself to have it not enough, I am not sure!
--- My apologizes for all that mess!!!! )
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hello evreyone,
this is my first post, and to say i'm new to this is an understatement.
I know very little about perl scripts and hope some one can help me.
i'm looking to get a script that a cron job can execute.
what the script needs to to is
1) connect to a mysql database
2) go to a... (2 Replies)
Discussion started by: Exader
2 Replies
2. Shell Programming and Scripting
I am trying to use a script to replace the header of each file, whose filename are stored within the array $test, using the sed command within a Perl script as follows:
$count = 0;
while ( $count < $#test )
{
`sed -e 's/BIOGRF 321/BIOGRF 332/g' ${test} > 0`;
`cat 0 >... (2 Replies)
Discussion started by: userix
2 Replies
3. Shell Programming and Scripting
so in unix this command works works and shows me a list of directories
find . -name \*.xls -exec dirname {} \; | sort -u | > list.txt
but when i try running a perl script to run this command
my $query = 'find . -name \*.xls -exec dirname {} \; | sort -u | > list.txt';... (2 Replies)
Discussion started by: kpddong
2 Replies
4. Shell Programming and Scripting
How can i print the output of a perl script on a unix console and redirect the same in a log file under same directory simultaneously ?
Like in Shell script, we use tee, is there anything in Perl or any other option ? (2 Replies)
Discussion started by: butterfly20
2 Replies
5. Shell Programming and Scripting
Hi Folks,
I have created a script last month to retrive files thru FTP and cronjob was running fine till yesterday. But the naming convention of the daily file is Filename_<date>.xml
where date is YYYYMMDD. But today i have received file name as Filename_20110232.xml :(
Part of my Perl... (4 Replies)
Discussion started by: Sendhil.Kumaran
4 Replies
6. Shell Programming and Scripting
Hi all,
Not sure if this should be in the programming forum, but I believe it will get more response under the Shell Programming and Scripting FORUM.
Am trying to write a customized df script in Perl and need some help with regards to using arrays and file handlers.
At the moment am... (3 Replies)
Discussion started by: newbie_01
3 Replies
7. Shell Programming and Scripting
hi All,
i have to modify a shell script written in Perl. i have to use execute immediate within this. i have to create a temporary table but it should have name like ar_data_$mmyyyy , how can i achieve this?
any help on this would be highly appriciated. (6 Replies)
Discussion started by: lovelysethii
6 Replies
8. Shell Programming and Scripting
Not sure what I am doing wrong here, but I can print the list with no issue. Just a blank screen with the 'do'.
#!/usr/bin/perl
open FILE, "upslist.txt";
while ($line=<FILE>){
if ($line=~/^(.*?),(.*?)$/){
#print "ups:$1 string:$2\n";
do 'check_snmp_mgeups-0.1.pl -H $1 -C $2';
} ... (1 Reply)
Discussion started by: mrlayance
1 Replies
9. Shell Programming and Scripting
Hello
Can some help with write part of perl script
I need something like this in perl
SSH="/bin/ssh -o BatchMode=yes -o"
USER="test"
SRV="server"
SCRIPT_TO_EXEC="/tmp/test.sh" -> shell script
OUT=/tmp/out.file
${SSH} -l ${USER} ${SRV} 'sudo /usr/bin/ksh -s' < ${SCRIPT_TO_EXEC} >> ${OUT}... (1 Reply)
Discussion started by: vikus
1 Replies
10. UNIX for Beginners Questions & Answers
Hi,
I am new to perl and have a script to which i want to ensure that no matter how many ever times i execute the script it should execute only once per day. Cronjob is not a safe method as I want to built in capability inside the script. (1 Reply)
Discussion started by: ctrld
1 Replies
LEARN ABOUT OPENDARWIN
slapd-perl
SLAPD-PERL(5) File Formats Manual SLAPD-PERL(5)
NAME
slapd-perl - Perl backend to slapd
SYNOPSIS
/etc/openldap/slapd.conf
DESCRIPTION
The Perl backend to slapd(8) works by embedding a perl(1) interpreter into slapd(8). Any perl database section of the configuration file
slapd.conf(5) must then specify what Perl module to use. Slapd then creates a new Perl object that handles all the requests for that par-
ticular instance of the backend.
You will need to create a method for each one of the following actions:
* new # creates a new object,
* search # performs the ldap search,
* compare # does a compare,
* modify # modifies an entry,
* add # adds an entry to backend,
* modrdn # modifies an entry's rdn,
* delete # deletes an ldap entry,
* config # process unknown config file lines,
* init # called after backend is initialized.
Unless otherwise specified, the methods return the result code which will be returned to the client. Unimplemented actions can just return
unwillingToPerform (53).
new This method is called when the configuration file encounters a perlmod line. The module in that line is then effectively `use'd
into the perl interpreter, then the new method is called to create a new object. Note that multiple instances of that object may be
instantiated, as with any perl object. The new method receives the class name as argument.
search This method is called when a search request comes from a client. It arguments are as follows:
* object reference
* base DN
* scope
* alias deferencing policy
* size limit
* time limit
* filter string
* attributes only flag (1 for yes)
* list of attributes to return (may be empty)
Return value: (resultcode, ldif-entry, ldif-entry, ...)
compare
This method is called when a compare request comes from a client. Its arguments are as follows.
* object reference
* dn
* attribute assertion string
modify This method is called when a modify request comes from a client. Its arguments are as follows.
* object reference
* dn
* a list formatted as follows
({ "ADD" | "DELETE" | "REPLACE" },
attributetype, value...)...
add This method is called when a add request comes from a client. Its arguments are as follows.
* object reference
* entry in string format
modrdn This method is called when a modrdn request comes from a client. Its arguments are as follows.
* object reference
* dn
* new rdn
* delete old dn flag (1 means yes)
delete This method is called when a delete request comes from a client. Its arguments are as follows.
* object reference
* dn
config This method is called with unknown slapd.conf(5) configuration file lines. Its arguments are as follows.
* object reference
* array of arguments on line
Return value: nonzero if this is not a valid option.
init This method is called after backend is initialized. Its argument is as follows.
* object reference
Return value: nonzero if initialization failed.
CONFIGURATION
These slapd.conf options apply to the PERL backend database. That is, they must follow a "database perl" line and come before any subse-
quent "backend" or "database" lines. Other database options are described in the slapd.conf(5) manual page.
perlModulePath /path/to/libs
Add the path to the @INC variable.
perlModule ModName
`Use' the module name ModName from ModName.pm
filterSearchResults
Search results are candidates that need to be filtered (with the filter in the search request), rather than search results to be
returned directly to the client.
EXAMPLE
There is an example Perl module `SampleLDAP' in the slapd/back-perl/ direcetory in the OpenLDAP source tree.
WARNING
The interface of this backend to the perl module MAY change. Any suggestions would greatly be appreciated.
FILES
/etc/openldap/slapd.conf
default slapd configuration file
SEE ALSO
slapd.conf(5), slapd(8), perl(1).
OpenLDAP 2.1.X RELEASEDATE SLAPD-PERL(5)