Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unix shell script problem...

Status
Not open for further replies.

Premalm

Programmer
Mar 20, 2002
164
US
Hi Guys,

I have a unix shell script which is like this...

sqlplus -s $FEB_UID/$FEB_PWD@feb_dev |&
print -p "select '|'||job_id||'|' from jobreq where status = 'PENDING';"
print -p "exit"
while read -p LINE
do
Item1=${LINE}
print ${Item1}
done

when I run the shell script the output is
'|'||JOB_ID||'|'
------------------------------------------
|116|
|117|
|118|
|119|
|120|
|121|

I only want the nos in ITEM1 variable ? how do i do this ?
any ideas ?

Thanks
Premal
 
Somthing like....

Item1=`echo ${LINE}| tr -d '|'`


I love deadlines. I like the whooshing sound they make as they fly by - Douglas Adams
 
There's a FAQ in the Shell Scripting forum which talks about controlling sqlplus from within scripts - well worth a read.

Mike

"Deliver me from the bane of civilised life; teddy bear envy."

Want to get great answers to your Tek-Tips questions? Have a look at faq219-2884

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top