This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Linux / UNIX and the fly likes Shell Script Basic Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "Shell Script Basic" Watch "Shell Script Basic" New topic
Author

Shell Script Basic

jaiser roney
Greenhorn

Joined: Jul 15, 2009
Posts: 16
Hi ,

i am working in a file #!/bin/sh


when i use below for loop its working fine , the value in $FORM_form_id_numbers is as 1234ad,45466,7890 and i am able to get each individual value separated by comma

IFS=","
for numb in "$FORM_form_id_numbers"; do
echo $numb
done


Also after preparing below sql i am able to have contents in out.log file

$ISQL << ! > ${L}/out.log
SELECT * FROM db_outerlayer..logger WHERE number_id="wer123_4545"
go
!


My problem starts when i put my sql in the for loop , after doing so i didnt get any error's not it provide any result , and out.log is empty , permission's for the out.log is proper.


IFS=","
for numb in "$FORM_form_id_numbers"; do

$ISQL << ! > ${L}/out.log
SELECT * FROM db_outerlayer..logger WHERE number_id=$numb
go
!

done


What is the problem in the above for loop which calls this sql.

Thank you in Advance
Sujoy Choudhury
Ranch Hand

Joined: Sep 17, 2008
Posts: 136

I think you are not appending to out.log so every time that file is getting created.
And in last execution may be nothing is written to the file.
Use >> instead to see all the output appended.


Thanks and Regards,
~Sujoy
 
Consider Paul's rocket mass heater.
 
subject: Shell Script Basic
 
Similar Threads
How to Parse Multitple Entities In Hibernate NativeSQL Returned List
Create Object in DoWhile Send to Arraylist
Log4j
calling a PL/SQL procedure from a Java application
need help using StringTokenizer