9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
I have browsed through the forums for a similar topic, but there is no topic which explains about this problem, when the backend is DB2.
I want to assign the output of a select count(*) from tablename to a unix variable in a shell script.
I am using ksh.
The database used to... (3 Replies)
Discussion started by: Siddarth
3 Replies
2. Shell Programming and Scripting
HI Unix Gurus,
I have a number of SELECT count(*) statements in an input file and I want to execute it using a shell script but one by one using loop in script....
How can I do this..... (7 Replies)
Discussion started by: ustechie
7 Replies
3. UNIX for Dummies Questions & Answers
Hi All
I've very nearly finished this script I'm working on but have hit another idiots problem, after googling I can't see a solution for this one.
I have a while count loop that checks checks two consecutive values then increments the count by two.
What the script has to do is then check... (5 Replies)
Discussion started by: Bashingaway
5 Replies
4. Shell Programming and Scripting
i want to select a variable created and use it in a if statement, but not getting the desired results
LINE='device for 0101a01: lpd://172.25.41.111:515'
prt=`echo $LINE | awk '{print $3 }' | cut -c 1-7`
echo $prt
My if statement to select just what i want..
IFS=$":"
while read prt... (11 Replies)
Discussion started by: ggoliath
11 Replies
5. UNIX for Dummies Questions & Answers
Hi,
I have file on below pattern, and i want to write a generic awk to handle all cases.
input_file:
col1~col2~col3~col4~col5~col6
I need to generate 4 files something like this
File1:
col1~~col2~~col3
File2:
col1~~col2~~col4
File3:
col1~~col2~~col5
File4:
col1~~col2~~col6 (1 Reply)
Discussion started by: luckybalaji
1 Replies
6. Shell Programming and Scripting
I am trying to assign an select statement into a variable. Can someone hel me with this.
example :
a='select * from dual'
echo $a should give me select * from dual
But this is not working. I trying with \ before * and quotes too. (1 Reply)
Discussion started by: rdhanek
1 Replies
7. Shell Programming and Scripting
How to redirect postgresql select query to a variable using shell scripts?
I tried to use
psql -c "select ip from servers" db | egrep '+\.+\+\+' | sed 's/^ *\(.*\) *$/\1/'
Output:
10.10.10.180
10.10.10.181
It display ip addresses from the databasem, but how could i redirect the... (3 Replies)
Discussion started by: uativan
3 Replies
8. Shell Programming and Scripting
As part of a bigger task, I had to read thru a file and separate records into various batches based on a field. Specifically, separate records based on the value in the batch field as defined below. The batch field left-justified numbers.
The datafile is here
> cat infile
12345 1 John Smith ... (5 Replies)
Discussion started by: joeyg
5 Replies
9. UNIX for Dummies Questions & Answers
Need to select count(*) from table to check for zero result in unix script (2 Replies)
Discussion started by: struggle
2 Replies