Sponsored Content
Top Forums Shell Programming and Scripting Unload utility with loop method Post 302124704 by kahuna on Monday 2nd of July 2007 08:55:42 AM
Old 07-02-2007
cedrichiu

I think you are overlaying $mOutFile.

Code:
    echo "unload to tmpfile select cust_num from customer where customer_t=$_customer_t;" | dbaccess demo
    
    cat tmpfile >>$mOutFile 
    


Last edited by kahuna; 07-02-2007 at 09:59 AM.. Reason: Oops, I had some extra quotes
 

9 More Discussions You Might Find Interesting

1. Linux

Is there any way to unload *.so by force?

In linux, dlclose can unload the dynamic linked library when the reference count decreases to zero. My questions is: Is there any way to unload the *.so without caring the reference count? (0 Replies)
Discussion started by: princelinux
0 Replies

2. Shell Programming and Scripting

Method to exit a for loop

Hi All, Can someone let me know how i can exit a for loop without exiting the script itself .... will the break statement work .... please help .... -Regards (2 Replies)
Discussion started by: Rohini Vijay
2 Replies

3. Shell Programming and Scripting

linux ISQL and MSSQL unload results to file

Hello, I am using suse 10.1 and isql from unixodbc to connect to a MS SQL server. I got everything to work fine. What do I need to unload the results from the sql to a file? I attempted to put unload to in my sql statement but got a error. I don't see in the isql help where it has a option to... (0 Replies)
Discussion started by: benefactr
0 Replies

4. Programming

infinite loop, synchronizing gossip-based method

the following code runs, but it hangs somewhere, i don't know why, #include<iostream> #include<vector> #include<cstdlib> #include<ctime> #include<list> #include<pthread.h> #include<cstring> using namespace std; pthread_mutex_t listlock = PTHREAD_MUTEX_INITIALIZER;... (3 Replies)
Discussion started by: saman_glorious
3 Replies

5. UNIX and Linux Applications

data unload in oracle 11g unix

:)hi, i work with ids and i've got a task now to load some data from oracle table to ids table. I'm trying to unload data from oracel tables. I use UNLOAD TO <filename> SELECT * FROM <table1>; sql in IDS to unload data to a unl. Is there a equivalent sql in oracle? Or is there any... (0 Replies)
Discussion started by: divak
0 Replies

6. Shell Programming and Scripting

data unload using shell

hi, I work on oracel 10g unix system. I need to unload data from few tables to a unl file using shell script. I've a file which contains the list of tables. The shell has to refer to this list and create a unl for each table. Table_list.txt table1| table2| table3| has to... (1 Reply)
Discussion started by: dvah
1 Replies

7. Shell Programming and Scripting

How do I number my for loop outputs with this method?

Currently I am outputting users and I want to number them starting with 1... grep name list.txt | awk -F"=" '{ print $2 }' | while read user; do echo -e "1\t|$user" Currently I have: 1 | john 1 | amy 1 | max I want it to look like 1 | john 2 | amy 3 | max (2 Replies)
Discussion started by: etranman1
2 Replies

8. Shell Programming and Scripting

Read parameter file in a shell script to unload a DB2 Table???

Hi , I Have following requirement: DB2 Sql query to pass from a parameter file for example, I would create a parameter file with (SELECT column 1, column 2 FROM Table name) then job would read it and create a file with the contents named table.txt How to write/modify below ksh script to... (10 Replies)
Discussion started by: developer.dwh9
10 Replies

9. Shell Programming and Scripting

Top utility in bash for loop

Dear All, is it possible to use top utility in for loop? I am trying to get top swap space consuming processes in my for loop. I got multiple way (using /proc FS) however have anybody used top command in for loop? Using /proc FS giving solutionbut itrs more complex. Please suggest if... (4 Replies)
Discussion started by: mail2vivek1
4 Replies
unload(n)						       Tcl Built-In Commands							 unload(n)

__________________________________________________________________________________________________________________________________________________

NAME
unload - Unload machine code SYNOPSIS
unload ?switches? fileName unload ?switches? fileName packageName unload ?switches? fileName packageName interp _________________________________________________________________ DESCRIPTION
This command tries to unload shared libraries previously loaded with load from the application's address space. fileName is the name of the file containing the library file to be unload; it must be the same as the filename provided to load for loading the library. The packageName argument is the name of the package (as determined by or passed to load), and is used to compute the name of the unload proce- dure; if not supplied, it is computed from fileName in the same manner as load. The interp argument is the path name of the interpreter from which to unload the package (see the interp manual entry for details); if interp is omitted, it defaults to the interpreter in which the unload command was invoked. If the initial arguments to unload start with - then they are treated as switches. The following switches are currently supported: -nocomplain Suppresses all error messages. If this switch is given, unload will never report an error. -keeplibrary This switch will prevent unload from issuing the operating system call that will unload the library from the process. -- Marks the end of switches. The argument following this one will be treated as a fileName even if it starts with a -. UNLOAD OPERATION When a file containing a shared library is loaded through the load command, Tcl associates two reference counts to the library file. The first counter shows how many times the library has been loaded into normal (trusted) interpreters while the second describes how many times the library has been loaded into safe interpreters. As a file containing a shared library can be loaded only once by Tcl (with the first load call on the file), these counters track how many interpreters use the library. Each subsequent call to load after the first simply increments the proper reference count. unload works in the opposite direction. As a first step, unload will check whether the library is unloadable: an unloadable library exports a special unload procedure. The name of the unload procedure is determined by packageName and whether or not the target interpreter is a safe one. For normal interpreters the name of the initialization procedure will have the form pkg_Unload, where pkg is the same as packa- geName except that the first letter is converted to upper case and all other letters are converted to lower case. For example, if package- Name is foo or FOo, the initialization procedure's name will be Foo_Unload. If the target interpreter is a safe interpreter, then the name of the initialization procedure will be pkg_SafeUnload instead of pkg_Unload. If unload determines that a library is not unloadable (or unload functionality has been disabled during compilation), an error will be returned. If the library is unloadable, then unload will call the unload procedure. If the unload procedure returns TCL_OK, unload will proceed and decrease the proper reference count (depending on the target interpreter type). When both reference counts have reached 0, the library will be detached from the process. UNLOAD HOOK PROTOTYPE The unload procedure must match the following prototype: typedef int Tcl_PackageUnloadProc(Tcl_Interp *interp, int flags); The interp argument identifies the interpreter from which the library is to be unloaded. The unload procedure must return TCL_OK or TCL_ERROR to indicate whether or not it completed successfully; in the event of an error it should set the interpreter's result to point to an error message. In this case, the result of the unload command will be the result returned by the unload procedure. The flags argument can be either TCL_UNLOAD_DETACH_FROM_INTERPRETER or TCL_UNLOAD_DETACH_FROM_PROCESS. In case the library will remain attached to the process after the unload procedure returns (i.e. because the library is used by other interpreters), TCL_UNLOAD_DETACH_FROM_INTERPRETER will be defined. However, if the library is used only by the target interpreter and the library will be detached from the application as soon as the unload procedure returns, the flags argument will be set to TCL_UNLOAD_DETACH_FROM_PROCESS. NOTES The unload command cannot unload libraries that are statically linked with the application. If fileName is an empty string, then the pack- ageName argument must be specified. If packageName is omitted or specified as an empty string, Tcl tries to guess the name of the package. This may be done differently on different platforms. The default guess, which is used on most UNIX platforms, is to take the last element of fileName, strip off the first three characters if they are lib, and use any following alphabetic and underline characters as the module name. For example, the command unload libxyz4.2.so uses the module name xyz and the command unload bin/last.so {} uses the module name last. PORTABILITY ISSUES
Unix Not all unix operating systems support library unloading. Under such an operating system unload returns an error (unless -nocomplain has been specified). BUGS
If the same file is loaded by different fileNames, it will be loaded into the process's address space multiple times. The behavior of this varies from system to system (some systems may detect the redundant loads, others may not). In case a library has been silently detached by the operating system (and as a result Tcl thinks the library is still loaded), it may be dangerous to use unload on such a library (as the library will be completely detached from the application while some interpreters will continue to use it). EXAMPLE
If an unloadable module in the file foobar.dll had been loaded using the load command like this (on Windows): load c:/some/dir/foobar.dll then it would be unloaded like this: unload c:/some/dir/foobar.dll This allows a C code module to be installed temporarily into a long-running Tcl program and then removed again (either because it is no longer needed or because it is being updated with a new version) without having to shut down the overall Tcl process. SEE ALSO
info sharedlibextension, load(n), safe(n) KEYWORDS
binary code, unloading, safe interpreter, shared library Tcl 8.5 unload(n)
All times are GMT -4. The time now is 03:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy