Sponsored Content
Top Forums Shell Programming and Scripting Want to understand the meaning of the following line Post 302118765 by dhanamurthy on Thursday 24th of May 2007 06:41:59 AM
Old 05-24-2007
Want to understand the meaning of the following line

HI All
Please find the code below from a script called test.sh

echo "Hello World"
. test_common.lib
get_info


in the file test_common.lib i have the following contents

get_info()
{
c_cnt=0;
cm="";
echo "Inside get_info"
}

when i run the script test.sh

i get a error message

test.sh: line 3: get_info: command not found

First of all i would like to know how this line behaves
"test_common.lib"


Regards
Dhanamurthy
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

what is the meaning here?

#!/bin/sh $ORACLE_HOME/bin/sqlplus -S $orauserid/$orapasswd@$oradb << _TMP alter session set nls_date_format = 'YYYYMMDD HH24:MI'; set linesize 100 set pagesize 400 ok the above is part of a script..i just wanna know what does sqlplus -S means?? as in why we need to insert the -S behind? (2 Replies)
Discussion started by: forevercalz
2 Replies

2. Shell Programming and Scripting

Meaning of this line in script

Can anyone explain me the meaning of line #2 in these lines of shell script: if ; then ${EXPR} " ${MACTIONS } " : ".* ${ACTION} " >/dev/null 2>&1 || die "$USAGE" else Sorry in case this is a trivial thing (I am not an expert in this). (3 Replies)
Discussion started by: radiatejava
3 Replies

3. What is on Your Mind?

Line 2238 Unix V6 Comment: You are not expected to understand this.

Here is the famous line 2238 of Unix V6 which is part of some of the most delicate parts of the kernel, context switching. This comment received huge publicity and just may be the the most famous source code comment in computing history. 2230 /* 2231 * If the new process paused because it... (0 Replies)
Discussion started by: Neo
0 Replies

4. Shell Programming and Scripting

meaning of !*

can someone please tell what !* means in shell syntax. Regards, (3 Replies)
Discussion started by: busyboy
3 Replies

5. UNIX for Dummies Questions & Answers

meaning of <<!

Hi all, I wanna know the meaning of the last word "<<! " sudo su - user <<! please help on this !!!! (1 Reply)
Discussion started by: sudharson
1 Replies

6. Shell Programming and Scripting

Help to understand multi-line

This code cat <<'EOF' Red Green Blue EOF gives output to screen Red Green Blue Same output as echo "Red" echo "Green" echo "Blue" (2 Replies)
Discussion started by: Jotne
2 Replies

7. Shell Programming and Scripting

Meaning

Please let me know the meaning for the below statements in shell scripting. 1) exit -99 -------------------------------- 2) set prgdir = `pwd` set runFlag = runFlag:FALSE ------------------------------------- 3) if (-f $prgdir/maillst.eml) then set distEmail = `cat $prgdir/maillst.eml`... (1 Reply)
Discussion started by: lg123
1 Replies

8. UNIX for Dummies Questions & Answers

What is meaning of given line?

Hello Guys, I was study some links, where I was unable to understand below line, please enhance me these code. (3 Replies)
Discussion started by: aaditya321
3 Replies

9. Shell Programming and Scripting

Need to understand how the line in perl program works as shell commend

I have a file with two line, one is header, the other actual value: TYPCD|ETID2|ETID|LEG ID|PTYP|PTYP SUB|TRD STATUS|CXL REASON|CACT|CACTNM|ENCD|ENC D NM|TRDR|ASDT|TRDT|MTDT|STDT|LS|SECID|SECID TYP|SECNM|PAR|STCC|MARKET PRICE|DIS MARKET PRICE|MARKET PRICE CURRENCY|SRC OF SETTLEMENT... (2 Replies)
Discussion started by: digioleg54
2 Replies

10. Shell Programming and Scripting

How to understand special character for line reading in bash shell?

I am still learning shell scripting. Recently I see a function for read configuration. But some of special character make me confused. I checked online to find answer. It was not successful. I post the code here to consult with expert or guru to get better understanding on these special characters... (3 Replies)
Discussion started by: duke0001
3 Replies
DBI::DBD::Metadata(3pm) 				User Contributed Perl Documentation				   DBI::DBD::Metadata(3pm)

NAME
DBI::DBD::Metadata - Generate the code and data for some DBI metadata methods SYNOPSIS
The idea is to extract metadata information from a good quality ODBC driver and use it to generate code and data to use in your own DBI driver for the same database. To generate code to support the get_info method: perl -MDBI::DBD::Metadata -e "write_getinfo_pm('dbi:ODBC:dsn-name','user','pass','Driver')" perl -MDBI::DBD::Metadata -e write_getinfo_pm dbi:ODBC:foo_db username password Driver To generate code to support the type_info method: perl -MDBI::DBD::Metadata -e "write_typeinfo_pm('dbi:ODBC:dsn-name','user','pass','Driver')" perl -MDBI::DBD::Metadata -e write_typeinfo_pm dbi:ODBC:dsn-name user pass Driver Where "dbi:ODBC:dsn-name" is the connection to use to extract the data, and "Driver" is the name of the driver you want the code generated for (the driver name gets embedded into the output in numerous places). Generating a GetInfo package for a driver The "write_getinfo_pm" in the DBI::DBD::Metadata module generates a DBD::Driver::GetInfo package on standard output. This method generates a DBD::Driver::GetInfo package from the data source you specified in the parameter list or in the environment variable DBI_DSN. DBD::Driver::GetInfo should help a DBD author implement the DBI get_info() method. Because you are just creating this package, it is very unlikely that DBD::Driver already provides a good implementation for get_info(). Thus you will probably connect via DBD::ODBC. Once you are sure that it is producing reasonably sane data, you should typically redirect the standard output to lib/DBD/Driver/GetInfo.pm, and then hand edit the result. Do not forget to update your Makefile.PL and MANIFEST to include this as an extra PM file that should be installed. If you connect via DBD::ODBC, you should use version 0.38 or greater; Please take a critical look at the data returned! ODBC drivers vary dramatically in their quality. The generator assumes that most values are static and places these values directly in the %info hash. A few examples show the use of CODE references and the implementation via subroutines. It is very likely that you will have to write additional subroutines for values depending on the session state or server version, e.g. SQL_DBMS_VER. A possible implementation of DBD::Driver::db::get_info() may look like: sub get_info { my($dbh, $info_type) = @_; require DBD::Driver::GetInfo; my $v = $DBD::Driver::GetInfo::info{int($info_type)}; $v = $v->($dbh) if ref $v eq 'CODE'; return $v; } Please replace Driver (or "<foo>") with the name of your driver. Note that this stub function is generated for you by write_getinfo_pm function, but you must manually transfer the code to Driver.pm. Generating a TypeInfo package for a driver The "write_typeinfo_pm" function in the DBI::DBD::Metadata module generates on standard output the data needed for a driver's type_info_all method. It also provides default implementations of the type_info_all method for inclusion in the driver's main implementation file. The driver parameter is the name of the driver for which the methods will be generated; for the sake of examples, this will be "Driver". Typically, the dsn parameter will be of the form "dbi:ODBC:odbc_dsn", where the odbc_dsn is a DSN for one of the driver's databases. The user and pass parameters are the other optional connection parameters that will be provided to the DBI connect method. Once you are sure that it is producing reasonably sane data, you should typically redirect the standard output to lib/DBD/Driver/TypeInfo.pm, and then hand edit the result if necessary. Do not forget to update your Makefile.PL and MANIFEST to include this as an extra PM file that should be installed. Please take a critical look at the data returned! ODBC drivers vary dramatically in their quality. The generator assumes that all the values are static and places these values directly in the %info hash. A possible implementation of DBD::Driver::type_info_all() may look like: sub type_info_all { my ($dbh) = @_; require DBD::Driver::TypeInfo; return [ @$DBD::Driver::TypeInfo::type_info_all ]; } Please replace Driver (or "<foo>") with the name of your driver. Note that this stub function is generated for you by the write_typeinfo_pm function, but you must manually transfer the code to Driver.pm. AUTHORS
Jonathan Leffler <jleffler@us.ibm.com> (previously <jleffler@informix.com>), Jochen Wiedmann <joe@ispsoft.de>, Steffen Goeldner <sgoeldner@cpan.org>, and Tim Bunce <dbi-users@perl.org>. perl v5.14.2 2010-07-02 DBI::DBD::Metadata(3pm)
All times are GMT -4. The time now is 04:57 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy