Sponsored Content
Top Forums Shell Programming and Scripting Difference between calling the sub scripts Post 302268676 by kingganesh04 on Tuesday 16th of December 2008 05:56:34 AM
Old 12-16-2008
Can u explain me with an example for each one?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Calling functions in scripts directly

Hi, I have a menu driven script that does various tasks, I want to be able to call functions directly from within other unix scripts from my menu script. Is this possible? (12 Replies)
Discussion started by: LiquidChild
12 Replies

2. Shell Programming and Scripting

script calling other scripts hangs

I have a script that calls several other scripts in a specified order: # Loop over actions in specified order (STOP_ORDER or START_ORDER) and build and evaluate commands for command in $(eval print '$'${action}_ORDER) do printf "`date`\tExecuting ${action}_${command} = `eval print... (1 Reply)
Discussion started by: rein
1 Replies

3. Shell Programming and Scripting

any possible solution on sql calling scripts

hi all, i have a function which will take i/p as a ddl sctipt as i/p and execute it, let function execute_sql { db_var="$1" v_cnt=`sqlplus -s XXXXX/XXXXX@aXXX << ENDSQL | sed -e "s/Connected\.//" -e "/^$/d" set pagesize 0 feedback off verify off heading off echo off serveroutput on size... (4 Replies)
Discussion started by: manas_ranjan
4 Replies

4. Shell Programming and Scripting

Issue calling scripts through CRON.

I have the following cron job in the crontab. #! /bin/bash 25 15 * * 1-5 /export/home/svittala/scripts/scpt1.sh >/dev/null 2>&1. The problem that I am facing is - the scpt1.sh can be executed manually. But, it is not executing through CRON. Not sure what's the issue. Any hints?. Thanks.... (5 Replies)
Discussion started by: vskr72
5 Replies

5. Solaris

difference in calling shell scripts

Hi I am getting some errors when i am running the shell script using the following syntax: >abc.sh but the same script works fine with the following syntax: >sh abc.sh wats the difference in both....please help thanks in advance. (6 Replies)
Discussion started by: arpit_narula
6 Replies

6. Shell Programming and Scripting

Calling Multiple Scripts - stops after 1

I have created a script to call 2-3 shell scripts to be execute in succession, however, it seems that after the first shell script completes, the entire script exits out. Example: 1stJob.sh 2ndJob.sh 1st Job - FTP files from Mainframe to Unix using the following commands at the tail of... (1 Reply)
Discussion started by: CKT_newbie88
1 Replies

7. Shell Programming and Scripting

Calling scripts within script

Hi, I have written a some six scripts to move large files and re-size them. This has been done step by step, taking backup, creating the new files, merging the files, removing the temporary files created. Since these files are around 500 MB, each step takes somewhere between 1 to 5 mins. ... (1 Reply)
Discussion started by: baanprog
1 Replies

8. Shell Programming and Scripting

Calling scripts from other script.

I need to call 3 different shell scripts from 2 different scripts, one is a perl script and other is Shell script. In Case -1 : The perl script is myperlscript.pl and the name of three shell scripts which need to be called from the perl script are a1.sh, a2.sh and a3.sh. Each shell script... (1 Reply)
Discussion started by: siba.s.nayak
1 Replies

9. Shell Programming and Scripting

Calling scripts from with scripts

Hi all, I'm wondering if you could give me some advice. I am new to scripting and am getting rather frustrated that i can get my script to call another script if certain criteria is met, via command line, but I cannot get the same script to work thru the cron jobs. My first script monitors... (8 Replies)
Discussion started by: echoes
8 Replies

10. Shell Programming and Scripting

Calling multiple scripts from another scripts

Dear all, I am working on script which call other shell scripts in a loop but problem is from second script am not able to come out. Here is the snippet:- #!/bin/bash HSFILE=/root/Test/Components.txt LOGFile=/opt/domain/AdminDomain/application/logs... (3 Replies)
Discussion started by: sharsour
3 Replies
MongoDB::Cursor(3pm)					User Contributed Perl Documentation				      MongoDB::Cursor(3pm)

NAME
MongoDB::Cursor - A cursor/iterator for Mongo query results SYNOPSIS
while (my $object = $cursor->next) { ... } my @objects = $cursor->all; Multithreading Cloning instances of this class is disabled in Perl 5.8.7+, so forked threads will have to create their own database queries. SEE ALSO
Core documentation on cursors: <http://dochub.mongodb.org/core/cursors>. STATIC ATTRIBUTES
slave_okay $MongoDB::Cursor::slave_okay = 1; Whether it is okay to run queries on the slave. Defaults to 0. timeout Deprecated, use MongoDB::Connection::query_timeout instead. How many milliseconds to wait for a response from the server. Set to 30000 (30 seconds) by default. -1 waits forever (or until TCP times out, which is usually a long time). This value is overridden by "MongoDB::Connection::query_timeout" and never used. ATTRIBUTES
started_iterating If this cursor has queried the database yet. Methods mofifying the query will complain if they are called after the database is queried. immortal $cursor->immortal(1); Ordinarily, a cursor "dies" on the database server after a certain length of time (approximately 10 minutes), to prevent inactive cursors from hogging resources. This option sets that a cursor should not die until all of its results have been fetched or it goes out of scope in Perl. Boolean value, defaults to 0. "immortal" is not equivalent to setting a client-side timeout. If you are getting client-side timeouts (e.g., "recv timed out"), set "query_timeout" on your connection. # wait forever for a query to return results $connection->query_timeout(-1); See "query_timeout" in MongoDB::Connection. tailable $cursor->tailable(1); If a cursor should be tailable. Tailable cursors can only be used on capped collections and are similar to the "tail -f" command: they never die and keep returning new results as more is added to a collection. They are often used for getting log messages. Boolean value, defaults to 0. partial If a shard is down, mongos will return an error when it tries to query that shard. If this is set, mongos will just skip that shard, instead. Boolean value, defaults to 0. slave_okay $cursor->slave_okay(1); If a query can be done on a slave database server. Boolean value, defaults to 0. METHODS
fields (\%f) $coll->insert({name => "Fred", age => 20}); my $cursor = $coll->query->fields({ name => 1 }); my $obj = $cursor->next; $obj->{name}; "Fred" $obj->{age}; # undef Selects which fields are returned. The default is all fields. _id is always returned. sort ($order) # sort by name, descending my $sort = {"name" => -1}; $cursor = $coll->query->sort($sort); Adds a sort to the query. Argument is either a hash reference or a Tie::IxHash. Returns this cursor for chaining operations. limit ($num) $per_page = 20; $cursor = $coll->query->limit($per_page); Returns a maximum of N results. Returns this cursor for chaining operations. skip ($num) $page_num = 7; $per_page = 100; $cursor = $coll->query->limit($per_page)->skip($page_num * $per_page); Skips the first N results. Returns this cursor for chaining operations. See also core documentation on limit: <http://dochub.mongodb.org/core/limit>. snapshot my $cursor = $coll->query->snapshot; Uses snapshot mode for the query. Snapshot mode assures no duplicates are returned, or objects missed, which were present at both the start and end of the query's execution (if an object is new during the query, or deleted during the query, it may or may not be returned, even with snapshot mode). Note that short query responses (less than 1MB) are always effectively snapshotted. Currently, snapshot mode may not be used with sorting or explicit hints. hint my $cursor = $coll->query->hint({'x' => 1}); Force Mongo to use a specific index for a query. explain my $explanation = $cursor->explain; This will tell you the type of cursor used, the number of records the DB had to examine as part of this query, the number of records returned by the query, and the time in milliseconds the query took to execute. Requires boolean package. "explain" resets the cursor, so calling "next" or "has_next" after an explain will requery the database. See also core documentation on explain: <http://dochub.mongodb.org/core/explain>. count($all?) my $num = $cursor->count; my $num = $cursor->skip(20)->count(1); Returns the number of document this query will return. Optionally takes a boolean parameter, indicating that the cursor's limit and skip fields should be used in calculating the count. reset Resets the cursor. After being reset, pre-query methods can be called on the cursor (sort, limit, etc.) and subsequent calls to next, has_next, or all will re-query the database. has_next while ($cursor->has_next) { ... } Checks if there is another result to fetch. next while (my $object = $cursor->next) { ... } Returns the next object in the cursor. Will automatically fetch more data from the server if necessary. Returns undef if no more data is available. info Returns a hash of information about this cursor. Currently the fields are: "cursor_id" The server-side id for this cursor. A "cursor_id" of 0 means that there are no more batches to be fetched. "num" The number of results returned so far. "at" The index of the result the cursor is currently at. "flag" If the database could not find the cursor or another error occurred, "flag" may be set (depending on the error). See http://www.mongodb.org/display/DOCS/Mongo+Wire+Protocol#MongoWireProtocol-OPREPLY <http://www.mongodb.org/display/DOCS/Mongo+Wire+Protocol#MongoWireProtocol-OPREPLY> for a full list of flag values. "start" The index of the result that the current batch of results starts at. all my @objects = $cursor->all; Returns a list of all objects in the result. AUTHOR
Kristina Chodorow <kristina@mongodb.org> perl v5.14.2 2011-09-07 MongoDB::Cursor(3pm)
All times are GMT -4. The time now is 08:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy