jaiser roney

Greenhorn
+ Follow
since Jul 15, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by jaiser roney



While typing the below command in the shell

sed -e 's/,/\',\'/g' -e 's/^/\'/' -e 's/$/\'/'

I was struggling typing caret character (^) , so i just copied from here , but if i want to actually type this character , what key combination should i use ?

12 years ago
Please ignore the last post ,

its a type error in L


it should be like

L=`echo $MyVAL |sed -e "s/,/'/g"`


instead of

L=`echo $MyVAL |sed -e "s/'/'/g"`


I would like to thank Anand Hariharan.

Thank you Sir.

12 years ago



Now escaping the single quotes becomes the biggest challenge for me , i tried various solutions but they didn't work.

Below is the basic information of the environment on which i am working
1) When i type echo $shell , on my environment , it prints /bin/csh

But i am testing after creating a shell file that starts #!/bin/sh ,

When i tried as

#!/bin/sh

MyVAL="foo,bar,tar"
L=`echo $MyVAL |sed -e "s/'/'/g"`
echo $L

I got foo,bar,tar as echo result


When i changed L as L=`echo $MyVAL |sed -e "s/'/\'/g"` I still get foo,bar,tar as echo result

When i changed L as L=`echo $MyVAL |sed -e "s/'/\\'/g"` I still get foo,bar,tar as echo result

When i changed L as L=`echo $MyVAL |sed -e "s/'/\\\'/g"` I still get foo,bar,tar as echo result

When i changed L as L=`echo $MyVAL |sed -e "s/'/\\\\'/g"` I still get foo,bar,tar as echo result

When i changed L as L=`echo $MyVAL |sed -e "s/'/\\\\\'/g"` I still get foo,bar,tar as echo result


It seems that now my primary question is how can i replace comma by single quote , i tried my solutions by googling but din't find any answer

Can anyone please help in this regard.

Thank you in Advance.





12 years ago
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
12 years ago
Hi ,

I am new to Shell Script , i am working in a file that starts as #!/bin/sh

In this file I am getting a form parameter $FORM_form_id_numbers which is having value as 1234ab,4578,9843dd,2365 my requirement is i wanted to pass this value as in IN clause as '1234ab','4578','9843dd','2365'

overall my requirement is to convert 1234ab,4578,9843dd,2365 into '1234ab','4578','9843dd','2365'

Please take care that after last element i don''t want any comma

How can i proceed for the same .

Thank you in Advance.





12 years ago
is there any reason why should i write the code in Action class ?
I m developing a web application in struts 2.0 framework . My question is where to write the code for maintaing the session of the user.

The session maintained by following code
org.apache.struts2.ServletActionContext.getRequest().getSession()
from the term session i mean session of the user ie the time between login and logout in the application
Hi All,

I have action ,helper and business logic classes in my project . Now I m in the phase of integrating the unit functionalities , my concern is which file to choose to write the code for maintaing the session of the user .

where can i get roles and responsibilites of action , helper and business logic files are they part of design patterns or something else.
what do i read for such issues.

Thanks in advance .
Hi All,

I m planning to make class diagrams of my project . I believe that we only make class diagram of meaning ful entities like Student , University , Enrollment so that we have relations ship as one student can enroll in more than one subject .

I have used struts framework in my project , i have action helper and business logic classess .

I m confused that Do I need to make class diagram and relation ship also for action helper and business logic classes or it is meaning less to make class diagram of this flow process classes or UML does not allow to show relationship between this class , only meaning ful entity classes should be mapped in the UML.


Please clarify . Thanks in Advance......................
Hi All,

I have installed Apache Tomcat/6.0.18 . I have configured it in the eclipse and successfully I m able to deploy web application , but when i try to access the default Tomcat home page by http://localhost:8080/ m getting error as below

HTTP Status 404 - /

type Status report

message /

description The requested resource (/) is not available.
Apache Tomcat/6.0.18


Please help
15 years ago
Hi All,

How can we make a method thread-safe (but in terminology we are talking about classes as thread safe) by declaring it as static, i know about synchronized concept but is it possible to make thread safe with only static key word.

15 years ago
Thank you Campbell,

I have one more query regarding Threads

How can we make a method thread-safe (but in terminology we are talking about classes as thread safe) by declaring it as static, i know about synchronized concept but is it possible to make thread safe with only static key word.
15 years ago
second point is missing a word

appology for the inconvenience

it as
2)An encapsulated class allows a programmer to change an
implementation without affecting outside code.
15 years ago
Hi all,

while going through basics of java i come around the below points for encapsulation. Can any one explain the points with example

1)An encapsulated, public class promotes re-use.

2)An encapsulated class allows a programmer to implementation without affecting outside code.

Thanks in advance.
15 years ago