06-13-2011
Generic script for Querying a DB
I have a few databases that i need to get some basic output from... so I'll be returning 1 or 2 records from a variety of different databases and the input queries will always differ.
What im looking for is a generic script that I can use across of the databases. Theory being i have:
mainscript.sh
configfile.cfg
In the config file is things such as db user and pw and type and a list of queries to run.
The mainscript will then go down the config file, connect to the db... run the queries 1 by 1 and echo the output. Obviously the amount of queries and types of databases will vary.
Anyone know of anything already in existance or can think of a funky way of doing this ?!
Any help at all is massively appreciated.
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have written generic script to transfer files from one machine to other machine(By passing the command line arguments like server name, user name ,location of the files, file names etc) but
when i am using sftp, what are the things I have to specify in the code
Is it necessary to specify... (0 Replies)
Discussion started by: gsri
0 Replies
2. Shell Programming and Scripting
I am trying to develop a script that can connect to a DB2 database mainframe and Query the database and display the results. I've been researching, but I have yet to find a definitive solution where I can enter in the Mainframe DB2 address db2:// and query the database and return the results. If... (2 Replies)
Discussion started by: developncode
2 Replies
3. HP-UX
Hello, all...
I've got an older HP-UX 11i machine hooked up to an HP VA array. I've never worked with VA arrays, so I was wondering if anyone could point me in the direction of some documentation on querying and manipulating VAs (HP VAs for Dummies or something).
I'm used to EMC arrays, so... (2 Replies)
Discussion started by: kknigga
2 Replies
4. Shell Programming and Scripting
Would appreciate if any one can paste a generic schell script to archive a file with date stamp by passing the file with fullpath as parameter
For Eg. /apps/scripts/Archive_File.sh /data_home/project_home/file.txt
this should place the file in the following directory
... (8 Replies)
Discussion started by: mak1600
8 Replies
5. Shell Programming and Scripting
Hi all,
I have a requirement to create a "superset" file out of a number of different sources with some different and some same columns.
We intend to have a manually updateable SuperSetCols.csv which would look like
"ColA","ColB","ColC","ColD","ColE","ColF","ColG"
so someday we may add... (3 Replies)
Discussion started by: Leedor
3 Replies
6. Shell Programming and Scripting
I am trying to work out if it is possible to create a generic scrip which will allow sftp to be run for connecting to a host machine based on a parameter and to retrieve files based on a batch file. The batch file bit I am fine with, I can make that work. The are I'm not so sure about is how to... (1 Reply)
Discussion started by: mike_p
1 Replies
7. Shell Programming and Scripting
Hi All,
Good morning...
I have prepared a shell script which will monitor files in a certain folder and if available, SCP it to a destination path.
Now the challenge I'm facing is my script is currently SCP-ing to only a single destination path. Wherever different destination path is in... (1 Reply)
Discussion started by: saps19
1 Replies
8. Shell Programming and Scripting
Hi all,
I'm trying to write a script to recursively cd into my Git projects and pull them, and will later expand it to build my projects as well.
I'm having a bit of trouble with my current script, as I want to supply a command line argument to tell it which branch to check out. I can hard... (2 Replies)
Discussion started by: Cows
2 Replies
9. UNIX for Beginners Questions & Answers
All,
I am trying to create a report on the duration of an ETL load from the file arrival to the final dump in to a database for SLA's.
Does anyone have any guidance or ideas on how metadata can be extracted; information of a file: like file name, created timestamp, count of records and load... (1 Reply)
Discussion started by: pradeepp
1 Replies
LEARN ABOUT MOJAVE
atsutil
atsutil(8) BSD System Manager's Manual atsutil(8)
NAME
atsutil -- font registration system utility
SYNOPSIS
atsutil fonts [-list | -verify]
atsutil databases [-remove | -removeUser]
atsutil server [-ping | -shutdown]
atsutil help
DESCRIPTION
atsutil tool controls some aspects of the font registration system. It may be used to modify font auto activation settings, font protection
settings, remove font registration databases and caches, or restart the font registration daemon.
fonts enumerates all fonts available to processes in the OS. It also performs a consistency check of the fonts available via font management
APIs.
databases will remove fontd System or User databases along with any cache files. Removing databases may cause the loss of font registration
state: fonts activated outside the standard font directories, font faces disabled, and font libraries. New databases will be regenerated from
fonts installed the standard font directories after the user logs out, restarts, or the fontd server is restarted.
server queries the status of fontd or shutdowns the fontd. Shutting down the fontd will spawn a new fontd. Shutting down the server is NOT
recommended and will likely lead to misrendered text or application crashes.
OPTIONS
fonts [-list | -verify]
-list lists and performs a consistency check on registered fonts.
-verify performs consistency a check on registered fonts.
databases [-remove | -removeUser]
-remove remove fontd databases for active user and system (used when no one is logged in and some background processes).
-removeUser remove fontd databases for the active user only.
server [-ping | -shutdown]
-ping query running fontd.
-shutdown shutdown fontd and spawn a new fontd. NOTE: this action is not recommended. See above.
SEE ALSO
fontd(8)
HISTORY
atsutil first appeared in MacOS X 10.5.
Mac OS June 1, 2019 Mac OS