I am writing a bash script on Solaris O/S. I looping through an array. For each iteration, i connect to the datatabase and use select statement. Output of which is redirected to .CSV file. here is the code for it.
But the problem is that .CSV file is getting overwritten because, for each iteration of the loop, database connection is getting opened and closed.
How to modify this code to
1) Open the database connection only once.
2) Loop through entire array. Pass the select statement output to the .CSV file
3) close database connection.
Any help is appreciated.
Thanks & Regards
Arundhati
Last edited by jim mcnamara; 08-18-2010 at 07:44 AM..
Reason: code tags please
Hi, My account is : abcd
I belong to a group: pqrs
Some thing straneg happened yesterday.
My .cshrc and .login got overwritten into pqrs's .cshrc and .login
I obviously did not explicitly overwrite pqrs's .cshrc.
Are there any reasons how this could have happened indirectly due to... (5 Replies)
Hello,
One of my frend had a problem.
He had Windows XP installed on his system. Then he installed Red Hat Linux 8.0 in one of the partitions. After some time his XP got corrupt and then he reinstalled Windows XP. This over wrote the Grub loader entry, and due to this the grub loader is not... (2 Replies)
We have a problem where we delete a user and their associated UID gets dumped back in the UID pool. The if we immediately create a another (new) user, AIX reuses the last UID, the one that was just released. This is causing a problem when reports are being generated because the new users name is... (2 Replies)
Due to my own stupidity I managed to overwrite my /dev/root device using dd (don't ask).
Current state is
- Have current backup created using cpio (command used was 'find . -mount -depth -print|cpio -ocB > $TAPE')
- Once I realised what was happening powered off the server but this was too... (2 Replies)
The following files were wiped out - new empty files were left in their place.
/etc/inittab, /etc/inetd.conf, and /etc/MANPATH
The system is running HP-UX 11i v3 - Mar08.
Anyone seen anything like this?
Any ideas on a way to figure this out if it happens again or a suggested way to... (9 Replies)
Hey peeps,
Here is somethin u might find interestin....
Is it possible to recover data from a partition which used to be an ext3 file sytem with some nice forgotten backups, which now is an lvm partion containg root partition of another OS. :)
I couldn't create any mess better than this, can... (2 Replies)
Hi,
The dump device on my system was set to /dev/dsk/c0t0d0s7. I have done a savecore -Lv on the system which worked fine. I'm wondering have I overwritten the rootdisk here by mistake? The system is still up but will need to be rebooted due to an error on it. Will it come back up?
... (8 Replies)
Hi, i have some problems with the following code:
char *tab_path;
char *sep=" \t\n";
char line;
char *p;
FILE * file;
int i = 0;
if(fgets(line,MAXLINE,file)!=NULL){
if((p=strtok(line,sep))!=NULL)tab_path=p;
while((p=strtok(NULL,sep))!=NULL){
i++;
... (4 Replies)
Hi All,
I am new new to unix.com, I have a question related to shell scripting.
We have a Oracle database backup shell script, which can be used for taking full, incremental & archive log backup based on the parameters passed.
Within the script we export a variable as
export... (5 Replies)
I had generated a ssh2 key on my AIX box, to receive files from other AIX and Linux systems.
Key Name: id_ssh2_server.pub
However this ssh2 key (both public and private keys) has been overwritten, while I was generating another ssh2 key. Now the earlier configured target systems are not able... (3 Replies)
Discussion started by: freakygs
3 Replies
LEARN ABOUT CENTOS
processcsv.py
PROCESSCSV.PY(1) Virtualization Support PROCESSCSV.PY(1)NAME
processcsv.py - process virt-top CSV files
SUMMARY
virt-top --csv data.csv
processcsv.py < data.csv
DESCRIPTION
virt-top is a top(1)-like utility for showing stats of virtualized domains.
processcsv.py is a simple Python script that post-processes the output of "virt-top --csv".
It is used like this:
virt-top --csv data.csv
processcsv.py < data.csv
The second command will overwrite the following files in the current directory:
"global.csv"
This contains the global (host) statistics columns from the CSV file.
"domainNN.csv" (multiple files)
For each libvirt domain ID NN, a file is created containing the per-domain statistics from the CSV file.
SEE ALSO virt-top(1)AUTHORS
Richard W.M. Jones <rjones @ redhat . com>
COPYRIGHT
(C) Copyright 2007-2012 Red Hat Inc., Richard W.M. Jones http://libvirt.org/
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation,
Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
virt-top-1.0.8 2013-12-29 PROCESSCSV.PY(1)