Sponsored Content
Top Forums Shell Programming and Scripting Shell script to pass the config file lines as variable on the respective called function on a script Post 303007148 by daPeach on Sunday 12th of November 2017 03:49:32 PM
Old 11-12-2017
as "config" files are named after the functions (or vice versa), you could use $FUNCNAME.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell Script to display function names (called & defined) in a C++ Source Code

Hello to all, I am looking for a way to display only the names of function (calls & definition) of a C++ source code.There is already a post related to this, but the script is to find the functions using a specific variable, and the replies are not that convincing since they cannot be used for... (2 Replies)
Discussion started by: frozensmilz
2 Replies

2. Shell Programming and Scripting

A shell script for create a a file in the respective path

Hello forum members, I have to create a out file in the current path./aaa/bbb/ccc/hhh. i am writing script below. ###script Begins##### #!/bin/ksh echo "Weclome" if then echo "Hello" rm -rf $aaa/bbb/ccc/hhh #clean the exsisting o/p file echo "no... (2 Replies)
Discussion started by: rajkumar_g
2 Replies

3. Shell Programming and Scripting

Unable to pass shell script variable to awk command in same shell script

I have a shell script (.sh) and I want to pass a parameter value to the awk command but I am getting exception, please assist. diff=$1$2.diff id=$2 new=new_$diff echo "My id is $1" echo "I want to sync for user account $id" ##awk command I am using is as below cat $diff | awk... (2 Replies)
Discussion started by: Ashunayak
2 Replies

4. Shell Programming and Scripting

Pass a variable string in To_Date Oracle function in shell script

Hello, I am trying to execute an SQL query from shell script. A part of script is something like this: fromDate=`echo $(date +"%F%T") | sed "s/-//g" | sed "s/://g"` $ORACLE_HOME/sqlplus -s /nolog <<EOD1 connect $COSDBUID/$COSDBPWD@$COSDBSID spool... (4 Replies)
Discussion started by: sanketpatel.86
4 Replies

5. UNIX for Dummies Questions & Answers

How to write Config shell script to pass variables in master shell script?

Dear Unix gurus, We have a config shell script file which has 30 variables which needs to be passed to master unix shell script that invokes oracle database sessions. So those 30 variables need to go through the database sessions (They are inputs) via a shell script. one of the variable name... (1 Reply)
Discussion started by: dba1981
1 Replies

6. Shell Programming and Scripting

How to write config shell script to pass variables in master shell script?

Dear Unix gurus, We have a config shell script file which has 30 variables which needs to be passed to master unix shell script that invokes oracle database sessions. So those 30 variables need to go through the database sessions (They are inputs) via a shell script. one of the variable name... (1 Reply)
Discussion started by: dba1981
1 Replies

7. Shell Programming and Scripting

What is the function of the following lines at the top of a shell script file: Directory and Script?

The file starts like this: Directory: <path to the script> Script: <script fife name> #!bin/ksh ##Comments <actual script> What is the use of the first two lines in the script? What if I save the file without them? What will be the effect? They are not comments. Im very new to this,... (4 Replies)
Discussion started by: remytom
4 Replies

8. UNIX for Beginners Questions & Answers

How to pass values to a script called from within another script in shell?

Need ideas on how to achieve the below. We have a script say "profile.sh" which internally calls another existing script called "name.sh" which prompts for the name and age of a person upon execution. When i run profile.sh how can i populate a pre-defined value from another file and pass that... (1 Reply)
Discussion started by: sankasu
1 Replies

9. UNIX for Beginners Questions & Answers

How to pass values to a script called from within another script in shell?

Ceiling Light - The Forgotten Element One of the highest details concerning using an LED ceiling panel essentially offer a fantastic dance floor which definitely makes the customers dance right away.They are a quite low cost method of something like a lighting solution, simple collection up,... (1 Reply)
Discussion started by: harveyclayton
1 Replies

10. UNIX for Beginners Questions & Answers

Pass config file to bash script

I just want to make sure I am understanding how to pass a config file to a bash script . In the below I pass to arguments to a script, then define them in the script as id and config. I then source config using ., if I understand correctly the variables in the config file can now be used by the... (11 Replies)
Discussion started by: cmccabe
11 Replies
QUERY(1)						User Contributed Perl Documentation						  QUERY(1)

NAME
XML::XQL::Query - Creates an XQL query evaluater from a XQL expression SYNOPSIS
use XML::XQL; $parser = new XML::DOM::Parser; $doc = $parser->parsefile ("file.xml"); # Return all elements with tagName='title' under the root element 'book' $query = new XML::XQL::Query (Expr => "book/title"); @result = $query->solve ($doc); # Or (to save some typing) @result = XML::XQL::solve ("book/title", $doc); DESCRIPTION
To perform XQL queries on an XML::DOM document (or, in the future, on other XML storage structures), you first have to create an XML::XQL::Query object and pass it a valid XQL query expression. You can then perform queries on one or more documents by calling the solve() method. XML
::XQL::Query constructor Usage, e.g: $query = new XML::XQL::Query( Expr => "book/author", Func => [ myfunc => &my_func, # define 2 functions myfunc2 => &my_func2 ], FuncArgCount => [ myfunc2 => [2, -1] ], # myfunc2 has 2 or more args AllowedOutSideSubquery => [ myfunc => 1 ], ConstFunc => [ myfunc2 => 1], CompareOper => [ mycmp => &mycmp ], # define comparison operator q => "str"); # use str// as string delim Expr => STRING The query expression to be evaluated. NodeQuery => BOOLEAN If set to 1, the query is a Node Query as opposed to a Full Query (which is the default.) A node query is a query that is only capable of returning Nodes. A full query is capable of returning Node values and non-Node values. Non-Node values include XML Primitives, element type names, namespace URI's, concatenated text nodes, and node type names. The distinction is significant because node queries may appear as XSL match and select patterns, while full queries have use in other applications. The difference between the two forms of queries is trivial and exists only as constraints on the syntax of node queries. Node queries may contain nested full queries. Func => [ FUNCNAME => FUNCREF, ...] Defines one or more functions. FUNCNAME is the name as used in the query expression. FUNCREF can be either a function reference like &my_func or an anonymous sub. See also: defineFunction Method => [ FUNCNAME => FUNCREF, ...] Defines one or more methods. FUNCNAME is the name as used in the query expression. FUNCREF can be either a function reference like &my_func or an anonymous sub. See also: defineMethod FuncArgCount => [ FUNCNAME => ARGCOUNT, ...] Defines the number of arguments for one or more functions or methods. FUNCNAME is the name as used in the query expression. See also: defineFunction and defineMethod AllowedOutsideSubquery => [ FUNCNAME => BOOLEAN, ...] Defines whether the specified function or method is allowed outside subqueries. FUNCNAME is the name as used in the query expression. See also: defineFunction and defineMethod ConstFunc => [ FUNCNAME => BOOLEAN, ...] Defines whether the function (not method!) is a "constant" function. FUNCNAME is the name as used in the query expression. See "Con- stant Function Invocations" for a definition of "constant" See also: defineFunction and defineMethod CompareOper => [ OPERNAME => FUNCREF, ...] Defines the comparison operator with the specified OPERNAME, e.g. if OPERNAME is "contains", you can use "$contains$" in the query. See also: defineComparisonOperators q => TOKEN Defines the q// token. See also: defineTokenQ qq => TOKEN Defines the qq// token. See also: defineTokenQQ Error => FUNCREF Defines the function that is called when errors occur during parsing the query expression. The default function prints an error message to STDERR. Debug => FLAGS Sets the debug level for the Yapp parser that parses the query expression. Default value is 0 (don't print anything). The maximum value is 0x17, which prints a lot of stuff. See the Parse::Yapp manpage for the meaning of the individual bits. Reserved hash keys Users may add their own (key, value) pairs to the Query constructor. Beware that the key 'Tree' is used internally. XML
::XQL::Query methods solve (INPUT_LIST...) Note that solve takes a list of nodes which are assumed to be in document order and must belong to the same document. E.g: $query = new XML::XQL::Query (Expr => "doc//book"); @result = $query->solve ($doc); @result2 = $query->solve ($node1, $node2, $node3); The following functions are also available at the query level, i.e. when called on a Query object they only affect this Query and no oth- ers: defineFunction, defineMethod, defineComparisonOperators, defineTokenQ, defineTokenQQ See Global functions for details. Another way to define these features for a particular Query is by passing the appropriate values to the XML::XQL::Query constructor. SEE ALSO
XML::XQL for general information about the XML::XQL module XML::XQL::Tutorial which describes the XQL syntax perl v5.8.0 2000-01-31 QUERY(1)
All times are GMT -4. The time now is 03:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy