Retrieve a particular value into a variable


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Retrieve a particular value into a variable
# 1  
Old 10-19-2010
Retrieve a particular value into a variable

Hi,

i am writing a shell script that will execute a select query. the select query returns one specific value.

Idql is used for quering in documentum...

Code:
X = $ (idql <docbase> -U<username> -<pwd> -Rdqlqueryfile.dql << !
set heading off
set footer off
!)

query in dqlqueryfile is
select attribute1 from table_1 where object_name = 'name';
echo $X

shows this

Code:
EMC Documentum idql - Interactive documentum query .......
...... >> 1> 2> attribute1 --------------------------------------------------------------------------------abc_01

How to get just abc_01 in a variable?


I have also stored the result in a file

It has the following entry

Code:
EMC Documentum idql - Interactive documentum query .......something else written here....

1>2>attribute1
-----------------------------------------------------------------------------------------
Abc_01
(1 row selected)
1>

how to retrive the value abc_01 from the file to a variable in the script that writes to this file,

Last edited by Scott; 10-19-2010 at 05:08 AM.. Reason: Added code tags, removed formatting
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Partial retrieve

I have this in log file /var/log/maillog XXX YYY ZZZ :15214 I=:25 AAA BBB CCC I need awk/sed operation on this, so that it retrieves only the first IP. cat /var/log/maillog | sed_operation 55.66.77.88 (2 Replies)
Discussion started by: anil510
2 Replies

2. Shell Programming and Scripting

How to retrieve string which does not contain '$'?

Hi, I have a file say file1.ksh. Which has data like: ifile $AI_SERIAL/$FILE.DAT... ofile $AI_SERIAL/feed.dat... My requirement is to find the count of all the lines which does not have $ after /. So i have written the code: grep -w 'AI_SERIAL' file1.ksh | cut -d '/' -f2 | grep... (9 Replies)
Discussion started by: Kamna
9 Replies

3. Shell Programming and Scripting

Retrieve logs for last 4 hours

Our log file looks like this: 2010-11-18 00:57:01,698 ERROR Shipment Error Log:Error Details - Account Id:3962, PO:2710015, Line:2, File:221112901, Version:V1, Desc:Order cannot not be shipped as there are no line items in New state 2010-11-18 14:59:39,960 ERROR... (11 Replies)
Discussion started by: Deepthz
11 Replies

4. UNIX for Dummies Questions & Answers

How to retrieve the value of variable in shell script which is called by crontab

There are two files one is shell script (sample.sh) and another is configuration file (sampl_conf.cfg) configuration file contains one variable $FTP_HOME. the value of this variable vaires for user to user. If user is say jadoo then value is /home/jadoo/ftp/, for user1 - /home/user1/ftp. The... (4 Replies)
Discussion started by: jadoo_c2
4 Replies

5. Shell Programming and Scripting

Retrieve the value of environment variable in shell script which called from crontab

There are two files one is shell script (sample.sh) and another is configuration file (sampl_conf.cfg) configuration file contains one variable $FTP_HOME. the value of this variable vaires for user to user. If user is say jadoo then value is /home/jadoo/ftp/, for user1 - /home/user1/ftp. The... (0 Replies)
Discussion started by: jadoo_c2
0 Replies

6. UNIX for Advanced & Expert Users

retrieve the file.

How will retrieve for a particular months file in UNIX say for example from January to February 2008. (1 Reply)
Discussion started by: rajesh08
1 Replies

7. Shell Programming and Scripting

how to retrieve only the Use% value from df command

when I do a df -k for a particular mount i get the result like this Filesystem 1K-blocks Used Available Use% Mounted on /dev/ 4128448 3527496 391240 91% / I need to extract the value 91 from this and use it in my script in an if condition. How will i do it Please advice. (8 Replies)
Discussion started by: codeman007
8 Replies

8. Shell Programming and Scripting

retrieve a value from a function and assign it to a variable

hi i have a function. parse() { qname="lpdma111" qmgr="lpdma111" qalias="lpqqali" } Now the requirement is i want ot get the vaues form the function start() { //retireve the values from the parse function } (5 Replies)
Discussion started by: Satyak
5 Replies

9. Shell Programming and Scripting

retrieve a value and assign it to a variable

hi i have a properties file and i am retrieving a value from that file. now i want to assign the retieved value to a variable can u please help (1 Reply)
Discussion started by: Satyak
1 Replies

10. Shell Programming and Scripting

retrieve value from a file

hi i have a cfg file,it contains lpdma520.dev.ipc.us.aexp.com=SUBMCORE.REQUEST.FT lpdma521.dev.ipc.us.aexp.com=SUBMCORE.REQUEST.FTREQ lpdma522.dev.ipc.us.aexp.com=SUBMITSECUREFILEFLOW i am retrieving the values using the function RetrieveCfgvalue() { CFG_VALUE=`grep "$2="... (1 Reply)
Discussion started by: satish@123
1 Replies
Login or Register to Ask a Question