including a library file ?????


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting including a library file ?????
# 1  
Old 01-17-2008
including a library file ?????

Whats the syntax for including a library file in a shell script?


say my shell script name is <abc.sh> and my library file is present in /user/abc/hello/fsfs/fsfsss/library.lib

Please tell how to include this library file in the shell script?????
# 2  
Old 01-17-2008
Quote:
Originally Posted by skyineyes
Whats the syntax for including a library file in a shell script?


say my shell script name is <abc.sh> and my library file is present in /user/abc/hello/fsfs/fsfsss/library.lib

Please tell how to include this library file in the shell script?????
I dont think you can include library files in a shell script. What are you trying to achieve ?
# 3  
Old 01-17-2008
hi vino

i have a text file with lots of database functions like execuing SQL directly or stored in a file.

i want to include that functions file in my shell script so that i can use those functions in the shell script.


Please provide any information




Quote:
Originally Posted by vino
I dont think you can include library files in a shell script. What are you trying to achieve ?
# 4  
Old 01-17-2008
Probably this would be some kind of answer to your question:
. file
Example:

script1.ksh:
#!/bin/ksh
. ./lib.ksh
shout 'message'
return 0

lib.ksh
#!/bin/ksh
function shout {
print -- "${1}"
return 0
}
# 5  
Old 01-18-2008
Thanks adderek !!!

Quote:
Originally Posted by adderek
Probably this would be some kind of answer to your question:
. file
Example:

script1.ksh:
#!/bin/ksh
. ./lib.ksh
shout 'message'
return 0

lib.ksh
#!/bin/ksh
function shout {
print -- "${1}"
return 0
}
# 6  
Old 01-18-2008
also -- check out the usage of FPATH
# 7  
Old 01-18-2008
as i told i am not having unix console right away. could you please explain that?

Thanks

Quote:
Originally Posted by frank_rizzo
also -- check out the usage of FPATH
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Pick the column value including comma from csv file using awk

Source 1 column1 column2 column 3 column4 1,ganesh,1,000,1 222,ram,2,000,5 222,ram,50,000,5 33,raju,5,000,7 33,raju,5,000,7 33,raju,5,000,8 33,raju,5,000,4 33,raju,5,000,1 In my .csv file, third column is having price value with comma (20,300), it has to be considered 1,000 as... (1 Reply)
Discussion started by: Ganesh L
1 Replies

2. Shell Programming and Scripting

Find file and zip without including directory path

Does anyone know of a way to zip the resulting file from a find command? My approach below finds the file and zips the entire directory path, which is not what I need. After scanning the web, it seems to be much easier to perform gzip, but unfortunately the approach must use zip. find `$DIR`... (5 Replies)
Discussion started by: koeji
5 Replies

3. Shell Programming and Scripting

Need help redirecting output to a file including errors

Need help redirecting output to a file including errors if any,I have 2 script namely push.ksh and run.ksh, I'm scp'ing push.ksh to another server and executing remotely via run.ksh, the script run.ksh runs locally but does not capture any errors in "servername.out" file (I tried testing various... (10 Replies)
Discussion started by: mbak
10 Replies

4. Shell Programming and Scripting

Run a bash script, display on the screen and save all information in a file including error info

Hi all, How to: Run a bash script, display on the screen and save all information in a file including error information. For example: I have a bash script called test.sh now I want to run the test.sh and display the output on the screen and save the output including error info to a file. ... (1 Reply)
Discussion started by: Damon sine
1 Replies

5. Shell Programming and Scripting

How to filter only comments while reading a file including line break characters.

How do I filter only comments and still keep Line breaks at the end of the line!? This is one of the common tasks we all do,, How can we do this in a right way..!? I try to ignore empty lines and commented lines using following approach. test.sh # \040 --> SPACE character octal... (17 Replies)
Discussion started by: kchinnam
17 Replies

6. Shell Programming and Scripting

how can I bcp out a table into a text file including the header row in the text file

Hi All, I need to BCP out a table into a text file along with the table headers. Normal BCP out command only bulk copies the data, and not the headers. I am using the following command: bcp database1..table1 out file1.dat -c -t\| -b1000 -A8192 -Uuser -Ppassword -efile.dat.err Regards,... (0 Replies)
Discussion started by: shilpa_acc
0 Replies

7. Shell Programming and Scripting

Command to get File Timestamp including seconds [Aix 5.3]

Is there a command (like ls -l) to get the file time stamp including seconds? The ls -l gives only the HH:MM, No SS I don't have a C compiler to call stat() I don't a command like stat too. Please help. (8 Replies)
Discussion started by: firdousamir
8 Replies

8. Shell Programming and Scripting

File permission setup including execution

Oracle uses 'dbadmin' user on UNIX and one of the oracle trigger creates a file. However, it doesn't provide 'Read' & 'Write' access to 'group' & 'other' users. Per security reasons, we shouldn't use 'umask' feature. We have been trying to use 'setfacl' commands to achieve the same, but couldn't... (2 Replies)
Discussion started by: MeganP
2 Replies

9. Shell Programming and Scripting

Reading a path (including ref to shell variable) from file

Hi! 1. I have a parameter file containing path to log files. For this example both paths are the same, one is stated directly and the second using env variables. /oracle/admin/orcl/bdump/:atlas:trc:N ${ORACLE_BASE}/admin/${ORACLE_SID}/bdump/:${ORACLE_SID}:trc:N 2. I try to parse the path... (1 Reply)
Discussion started by: lojzev
1 Replies

10. UNIX for Advanced & Expert Users

file creation date including seconds

Hi, Is anybody can help me to get the file creation date with seconds? -rw-r--r-- 1 opsc system 422550845 Aug 22 15:41 StatData.20020821 Thanks in advance Krishna (7 Replies)
Discussion started by: krishna
7 Replies
Login or Register to Ask a Question