Re: How to write IF Else condition inRunsShellScript component?

"Shrishailappa Awanty, Ambika (STSD)" <[email protected]> Tue, 20 Feb 2007 10:02:10 +0530
Newsgroups gmane.comp.java.smartfrog.devel
Message-ID <35F72B76D6E41B4F8B56A0098D96738C011B6906@bgeexc06.asiapacific.cpqcorp.net>
This is a multi-part message in MIME format.

--===============2005410123==
Content-class: urn:content-classes:message
Content-Type: multipart/alternative;
	boundary="----_=_NextPart_001_01C754A8.16A60691"

This is a multi-part message in MIME format.

------_=_NextPart_001_01C754A8.16A60691
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hi Patrick,
    Thanks for quick reply. Its working for me.
=20
Thanks and Regards,
Ambika
=20

________________________________

From: Goldsack, Patrick=20
Sent: Monday, February 19, 2007 5:21 PM
To: Ambika Awanty; smartfrog-developer-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Cc: Shrishailappa Awanty, Ambika (STSD)
Subject: RE: [Smartfrog-developer] How to write IF Else condition
inRunsShellScript component?


There are two ways in which you might enter this command:=20
=20
firstly as a multi-line string (should work, but I haven't tried it),=20
=20
##
if [ -s /tmp/list ]
then
echo "Not empty"
else
echo "Empty"
fi
#
=20
the second as a single line using ; as a separator for the lines and
escaping "
=20
"if [ -s /tmp/list ] ; then echo \"Not empty\"; else echo \"Empty\"; fi"
=20
Patrick

________________________________

From: smartfrog-developer-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
[mailto:smartfrog-developer-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org] On Behalf Of
Ambika Awanty
Sent: 19 February 2007 10:35
To: smartfrog-developer-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Cc: Shrishailappa Awanty, Ambika (STSD)
Subject: [Smartfrog-developer] How to write IF Else condition
inRunsShellScript component?



Hi All,
   Can any one tell me how to write following logic in cmd field of
RunShellScripts ?
=20
if [ -s /tmp/list ]
then
echo "Not empty"
else
echo "Empty"
fi
=20
   I cant write this in a file and execute that file in shell, because i
want to deploy this component in another node, where this file wont be
available.
=20
Thanks and Regards,
ambika
=20

=20

________________________________

Here's a new way to find what you're looking for - Yahoo! Answers
<http://us.rd.yahoo.com/mail/in/yanswers/*http://in.answers.yahoo.com/>


------_=_NextPart_001_01C754A8.16A60691
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<META content=3D"MSHTML 6.00.2900.3020" name=3DGENERATOR></HEAD>
<BODY>
<DIV dir=3Dltr align=3Dleft><SPAN class=3D364243104-20022007><FONT =
face=3DArial=20
color=3D#0000ff size=3D2>Hi Patrick,</FONT></SPAN></DIV>
<DIV dir=3Dltr align=3Dleft><SPAN =
class=3D364243104-20022007>&nbsp;&nbsp;&nbsp; <FONT=20
face=3DArial color=3D#0000ff size=3D2>Thanks for quick reply. Its =
working for=20
me.</FONT></SPAN></DIV>
<DIV dir=3Dltr align=3Dleft><SPAN class=3D364243104-20022007><FONT =
face=3DArial=20
color=3D#0000ff size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=3Dltr align=3Dleft><SPAN class=3D364243104-20022007><FONT =
face=3DArial=20
color=3D#0000ff size=3D2>Thanks and Regards,</FONT></SPAN></DIV>
<DIV dir=3Dltr align=3Dleft><SPAN class=3D364243104-20022007><FONT =
face=3DArial=20
color=3D#0000ff size=3D2>Ambika</FONT></SPAN></DIV>
<DIV dir=3Dltr align=3Dleft><SPAN =
class=3D364243104-20022007></SPAN>&nbsp;</DIV><BR>
<DIV class=3DOutlookMessageHeader lang=3Den-us dir=3Dltr align=3Dleft>
<HR tabIndex=3D-1>
<FONT face=3DTahoma size=3D2><B>From:</B> Goldsack, Patrick =
<BR><B>Sent:</B> Monday,=20
February 19, 2007 5:21 PM<BR><B>To:</B> Ambika Awanty;=20
smartfrog-developer-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org<BR><B>Cc:</B> Shrishailappa =
Awanty,=20
Ambika (STSD)<BR><B>Subject:</B> RE: [Smartfrog-developer] How to write =
IF Else=20
condition inRunsShellScript component?<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV dir=3Dltr align=3Dleft><SPAN class=3D036464611-19022007><FONT =
face=3DArial=20
color=3D#0000ff size=3D2>There are two ways in which you might enter =
this command:=20
</FONT></SPAN></DIV>
<DIV dir=3Dltr align=3Dleft><SPAN class=3D036464611-19022007><FONT =
face=3DArial=20
color=3D#0000ff size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=3Dltr align=3Dleft><SPAN class=3D036464611-19022007><FONT =
face=3DArial=20
color=3D#0000ff size=3D2>firstly as a multi-line string (should work, =
but I haven't=20
tried it), </FONT></SPAN></DIV>
<DIV dir=3Dltr align=3Dleft><SPAN class=3D036464611-19022007><FONT =
face=3DArial=20
color=3D#0000ff size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=3Dltr align=3Dleft><SPAN class=3D036464611-19022007><FONT =
face=3DArial=20
color=3D#0000ff size=3D2>##</FONT></SPAN></DIV>
<DIV dir=3Dltr align=3Dleft><SPAN class=3D036464611-19022007><FONT =
face=3DArial=20
color=3D#0000ff size=3D2>
<DIV>if [ -s /tmp/list ]</DIV>
<DIV>then</DIV>
<DIV>echo "Not empty"</DIV>
<DIV>else</DIV>
<DIV>echo "Empty"</DIV>
<DIV>fi</DIV></FONT></SPAN></DIV>
<DIV dir=3Dltr align=3Dleft><SPAN class=3D036464611-19022007><FONT =
face=3DArial=20
color=3D#0000ff size=3D2>#</FONT></SPAN></DIV>
<DIV dir=3Dltr align=3Dleft><SPAN class=3D036464611-19022007><FONT =
face=3DArial=20
color=3D#0000ff size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=3Dltr align=3Dleft><SPAN class=3D036464611-19022007><FONT =
face=3DArial=20
color=3D#0000ff size=3D2>the second as a single line using ; as a =
separator for the=20
lines and escaping "</FONT></SPAN></DIV>
<DIV dir=3Dltr align=3Dleft><SPAN class=3D036464611-19022007><FONT =
face=3DArial=20
color=3D#0000ff size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=3Dltr align=3Dleft><SPAN class=3D036464611-19022007>
<DIV><SPAN class=3D036464611-19022007>"</SPAN>if [ -s /tmp/list ]<SPAN=20
class=3D036464611-19022007> ; </SPAN>then<SPAN =
class=3D036464611-19022007>=20
</SPAN>echo&nbsp;<SPAN class=3D036464611-19022007>\</SPAN>"Not =
empty<SPAN=20
class=3D036464611-19022007>\</SPAN>"<SPAN class=3D036464611-19022007>;=20
</SPAN>else<SPAN class=3D036464611-19022007> </SPAN>echo&nbsp;<SPAN=20
class=3D036464611-19022007>\</SPAN>"Empty<SPAN=20
class=3D036464611-19022007>\</SPAN>"<SPAN class=3D036464611-19022007>;=20
</SPAN>fi<SPAN class=3D036464611-19022007>"</SPAN></DIV>
<DIV><SPAN class=3D036464611-19022007></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D036464611-19022007><FONT face=3DArial color=3D#0000ff =

size=3D2>Patrick</FONT></SPAN></DIV></SPAN></DIV><BR>
<DIV class=3DOutlookMessageHeader lang=3Den-us dir=3Dltr align=3Dleft>
<HR tabIndex=3D-1>
<FONT face=3DTahoma size=3D2><B>From:</B>=20
smartfrog-developer-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org=20
[mailto:smartfrog-developer-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org] <B>On Behalf =
Of=20
</B>Ambika Awanty<BR><B>Sent:</B> 19 February 2007 10:35<BR><B>To:</B>=20
smartfrog-developer-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org<BR><B>Cc:</B> Shrishailappa =
Awanty,=20
Ambika (STSD)<BR><B>Subject:</B> [Smartfrog-developer] How to write IF =
Else=20
condition inRunsShellScript component?<BR></FONT><BR></DIV>
<DIV></DIV><BR>
<DIV>Hi All,</DIV>
<DIV>&nbsp;&nbsp; Can any one tell me how to write following logic in =
cmd field=20
of RunShellScripts ?</DIV>
<DIV>&nbsp;</DIV>
<DIV>if [ -s /tmp/list ]</DIV>
<DIV>then</DIV>
<DIV>echo "Not empty"</DIV>
<DIV>else</DIV>
<DIV>echo "Empty"</DIV>
<DIV>fi</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp; I cant write this in a file and execute that file in =
shell,=20
because i want to deploy this component in another node, where this file =
wont be=20
available.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks and Regards,</DIV>
<DIV>ambika</DIV>
<DIV>&nbsp;</DIV>
<DIV><BR>&nbsp;</DIV>
<P>
<HR SIZE=3D1>
</HR>Here&#8217;s a new way to find what you're looking for - <A=20
href=3D"http://us.rd.yahoo.com/mail/in/yanswers/*http://in.answers.yahoo.=
com/">Yahoo!=20
Answers</A> </BODY></HTML>

------_=_NextPart_001_01C754A8.16A60691--


--===============2005410123==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
--===============2005410123==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Smartfrog-developer mailing list
Smartfrog-developer-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/smartfrog-developer

--===============2005410123==--