<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: If sentence .. in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/if-sentence/m-p/3691271#M103281</link>
    <description>Manuales,&lt;BR /&gt;if you type man test it will show some useful syntax.&lt;BR /&gt;</description>
    <pubDate>Wed, 14 Dec 2005 11:02:34 GMT</pubDate>
    <dc:creator>Peter Godron</dc:creator>
    <dc:date>2005-12-14T11:02:34Z</dc:date>
    <item>
      <title>If sentence ..</title>
      <link>https://community.hpe.com/t5/operating-system-linux/if-sentence/m-p/3691268#M103278</link>
      <description>hi ..&lt;BR /&gt;how cay i use if to indicate a sentence:&lt;BR /&gt;if $a (is bigger than) $b&lt;BR /&gt;then ...&lt;BR /&gt;&lt;BR /&gt;"is bigger than" how can i indicate it in if sentence? is like -ge? is like -aq? what is, i don't remember it ...!!!&lt;BR /&gt;&lt;BR /&gt;Thanks, Manuales.</description>
      <pubDate>Wed, 14 Dec 2005 10:57:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/if-sentence/m-p/3691268#M103278</guid>
      <dc:creator>Manuales</dc:creator>
      <dc:date>2005-12-14T10:57:43Z</dc:date>
    </item>
    <item>
      <title>Re: If sentence ..</title>
      <link>https://community.hpe.com/t5/operating-system-linux/if-sentence/m-p/3691269#M103279</link>
      <description>if (( $a &amp;gt; $b ))&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff&lt;BR /&gt;</description>
      <pubDate>Wed, 14 Dec 2005 11:00:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/if-sentence/m-p/3691269#M103279</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2005-12-14T11:00:33Z</dc:date>
    </item>
    <item>
      <title>Re: If sentence ..</title>
      <link>https://community.hpe.com/t5/operating-system-linux/if-sentence/m-p/3691270#M103280</link>
      <description>&lt;BR /&gt;if [ $a -gt $b ]&lt;BR /&gt;then&lt;BR /&gt;...&lt;BR /&gt;fi&lt;BR /&gt;</description>
      <pubDate>Wed, 14 Dec 2005 11:02:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/if-sentence/m-p/3691270#M103280</guid>
      <dc:creator>Slawomir Gora</dc:creator>
      <dc:date>2005-12-14T11:02:00Z</dc:date>
    </item>
    <item>
      <title>Re: If sentence ..</title>
      <link>https://community.hpe.com/t5/operating-system-linux/if-sentence/m-p/3691271#M103281</link>
      <description>Manuales,&lt;BR /&gt;if you type man test it will show some useful syntax.&lt;BR /&gt;</description>
      <pubDate>Wed, 14 Dec 2005 11:02:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/if-sentence/m-p/3691271#M103281</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2005-12-14T11:02:34Z</dc:date>
    </item>
    <item>
      <title>Re: If sentence ..</title>
      <link>https://community.hpe.com/t5/operating-system-linux/if-sentence/m-p/3691272#M103282</link>
      <description>thanks, buy if you use "test"&lt;BR /&gt;&lt;BR /&gt;if test $a ...... Bb&lt;BR /&gt;&lt;BR /&gt;whad do you put in space "...." ?&lt;BR /&gt;&lt;BR /&gt;Tnanks, Manuales.</description>
      <pubDate>Wed, 14 Dec 2005 11:02:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/if-sentence/m-p/3691272#M103282</guid>
      <dc:creator>Manuales</dc:creator>
      <dc:date>2005-12-14T11:02:59Z</dc:date>
    </item>
    <item>
      <title>Re: If sentence ..</title>
      <link>https://community.hpe.com/t5/operating-system-linux/if-sentence/m-p/3691273#M103283</link>
      <description>ksh:&lt;BR /&gt;&lt;BR /&gt;for strings:&lt;BR /&gt;"="  equal &lt;BR /&gt;"!=" not equal&lt;BR /&gt;&lt;BR /&gt;for numbers:&lt;BR /&gt;"-eq" equal&lt;BR /&gt;"-ne" not equal &lt;BR /&gt;"-gt" greater than&lt;BR /&gt;"-lt" less than&lt;BR /&gt;&lt;BR /&gt;Regards</description>
      <pubDate>Wed, 14 Dec 2005 11:04:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/if-sentence/m-p/3691273#M103283</guid>
      <dc:creator>Oviwan</dc:creator>
      <dc:date>2005-12-14T11:04:49Z</dc:date>
    </item>
    <item>
      <title>Re: If sentence ..</title>
      <link>https://community.hpe.com/t5/operating-system-linux/if-sentence/m-p/3691274#M103284</link>
      <description>Hi Manuales:&lt;BR /&gt;&lt;BR /&gt;I assume that you want the Posix (or 'ksh') shell syntax.&lt;BR /&gt;&lt;BR /&gt;If so, see the man pages for 'test' and the man pages for 'sh-posix'.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 14 Dec 2005 11:07:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/if-sentence/m-p/3691274#M103284</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2005-12-14T11:07:57Z</dc:date>
    </item>
    <item>
      <title>Re: If sentence ..</title>
      <link>https://community.hpe.com/t5/operating-system-linux/if-sentence/m-p/3691275#M103285</link>
      <description>Manuales,&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;a="A"&lt;BR /&gt;b="B"&lt;BR /&gt;if [[ "$a" &amp;gt; "$b" ]]&lt;BR /&gt;then&lt;BR /&gt;echo a greater than b&lt;BR /&gt;else&lt;BR /&gt;echo a not greater than b&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 14 Dec 2005 11:10:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/if-sentence/m-p/3691275#M103285</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2005-12-14T11:10:43Z</dc:date>
    </item>
    <item>
      <title>Re: If sentence ..</title>
      <link>https://community.hpe.com/t5/operating-system-linux/if-sentence/m-p/3691276#M103286</link>
      <description>The "test" command and its equivalent "[ ... ]" syntax are different then the "[[ ... ]]" syntax used in "ksh".&lt;BR /&gt; &lt;BR /&gt;A review of "man test" and "man ksh" will explain the differences.&lt;BR /&gt; &lt;BR /&gt;For instance-&lt;BR /&gt;if [ ab = a* ]... is false since it is a string compare, whereas&lt;BR /&gt;if [[ ab = a* ]]... is true since it is doing a pattern match.&lt;BR /&gt; &lt;BR /&gt;read the "man" pages for the details...&lt;BR /&gt; &lt;BR /&gt;Rod Hills</description>
      <pubDate>Wed, 14 Dec 2005 11:14:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/if-sentence/m-p/3691276#M103286</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2005-12-14T11:14:34Z</dc:date>
    </item>
    <item>
      <title>Re: If sentence ..</title>
      <link>https://community.hpe.com/t5/operating-system-linux/if-sentence/m-p/3691277#M103287</link>
      <description>i'm using csh&lt;BR /&gt;why do i have next error?&lt;BR /&gt;serverunix:girl1 279&amp;gt; prueba.csh&lt;BR /&gt;if: Expression syntax.  &lt;BR /&gt;&lt;BR /&gt;my script is:&lt;BR /&gt;if ($bb = 1) &lt;BR /&gt;then&lt;BR /&gt;echo "hola"&lt;BR /&gt;else&lt;BR /&gt;echo "adios"&lt;BR /&gt;eif&lt;BR /&gt;&lt;BR /&gt;why is the problem??&lt;BR /&gt;&lt;BR /&gt;Thanks, Manuales.</description>
      <pubDate>Wed, 14 Dec 2005 14:03:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/if-sentence/m-p/3691277#M103287</guid>
      <dc:creator>Manuales</dc:creator>
      <dc:date>2005-12-14T14:03:28Z</dc:date>
    </item>
    <item>
      <title>Re: If sentence ..</title>
      <link>https://community.hpe.com/t5/operating-system-linux/if-sentence/m-p/3691278#M103288</link>
      <description>try this:&lt;BR /&gt;&lt;BR /&gt;if ($bb = 1) then&lt;BR /&gt;  echo "hola"&lt;BR /&gt;else&lt;BR /&gt;  echo "adios"&lt;BR /&gt;endif</description>
      <pubDate>Wed, 14 Dec 2005 14:15:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/if-sentence/m-p/3691278#M103288</guid>
      <dc:creator>Oviwan</dc:creator>
      <dc:date>2005-12-14T14:15:57Z</dc:date>
    </item>
    <item>
      <title>Re: If sentence ..</title>
      <link>https://community.hpe.com/t5/operating-system-linux/if-sentence/m-p/3691279#M103289</link>
      <description>CSH is a completely different beast from sh or ksh.&lt;BR /&gt;&lt;BR /&gt;Your script should be:&lt;BR /&gt;&lt;BR /&gt;if ( $bb == 1 ) then&lt;BR /&gt;echo "hola"&lt;BR /&gt;else&lt;BR /&gt;echo "adios"&lt;BR /&gt;endif&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Note the differences.&lt;BR /&gt;&lt;BR /&gt;1st line -- You needs space between the open and close parentheses and the expressions.  Also you needed a '==' (2 equal signs together) and the 'then' needs to be on the first line.&lt;BR /&gt;&lt;BR /&gt;The last line of the script has to be 'endif'.&lt;BR /&gt;&lt;BR /&gt;# man csh &lt;BR /&gt;&lt;BR /&gt;will give you a LOT of info on the C-shell.</description>
      <pubDate>Wed, 14 Dec 2005 14:17:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/if-sentence/m-p/3691279#M103289</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2005-12-14T14:17:19Z</dc:date>
    </item>
    <item>
      <title>Re: If sentence ..</title>
      <link>https://community.hpe.com/t5/operating-system-linux/if-sentence/m-p/3691280#M103290</link>
      <description>Thanks Patrick !!&lt;BR /&gt;&lt;BR /&gt;i've worked with ksh ..&lt;BR /&gt;&lt;BR /&gt;do you know if with csh you can make functiions llike ksh? it means, with ksh there is a variable specially to redirect a path where there will be functions .. do you kwno if this exists to csh?&lt;BR /&gt;&lt;BR /&gt;Thanks, Manuales.</description>
      <pubDate>Wed, 14 Dec 2005 14:28:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/if-sentence/m-p/3691280#M103290</guid>
      <dc:creator>Manuales</dc:creator>
      <dc:date>2005-12-14T14:28:15Z</dc:date>
    </item>
    <item>
      <title>Re: If sentence ..</title>
      <link>https://community.hpe.com/t5/operating-system-linux/if-sentence/m-p/3691281#M103291</link>
      <description>Hi Manuales:&lt;BR /&gt;&lt;BR /&gt;The 'csh' shell is far inferior to the Posix ('usr/bin/sh'), 'ksh', and 'bash' shells.&lt;BR /&gt;&lt;BR /&gt;See here, for one discussion of why *not* to use 'csh':&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/" target="_blank"&gt;http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Beyond, that, on HP-UX, for the 'root' account, in '/etc/passwd', NEVER specify any shell other than '/sbin/sh'.  To do so will render your server unusable.&lt;BR /&gt;&lt;BR /&gt;The Posix shell lives in '/sbin/sh' as a staticly-linked binary.  As such, everything it needs to run is available in single-user mode (when '/usr' isn't mounted).  The Posix shell in '/usr/bin/sh' is for general users and uses dynamically linked libraries in '/usr'.  Non-root users should specify this shell in preference to '/sbin/sh'.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 14 Dec 2005 14:35:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/if-sentence/m-p/3691281#M103291</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2005-12-14T14:35:31Z</dc:date>
    </item>
    <item>
      <title>Re: If sentence ..</title>
      <link>https://community.hpe.com/t5/operating-system-linux/if-sentence/m-p/3691282#M103292</link>
      <description>I don't know that much about csh.  I would advise you to read the man page if you must use csh.&lt;BR /&gt;&lt;BR /&gt;I try to avoid it if at all possible.  I much prefer the POSIX shell.</description>
      <pubDate>Wed, 14 Dec 2005 14:47:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/if-sentence/m-p/3691282#M103292</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2005-12-14T14:47:37Z</dc:date>
    </item>
    <item>
      <title>Re: If sentence ..</title>
      <link>https://community.hpe.com/t5/operating-system-linux/if-sentence/m-p/3691283#M103293</link>
      <description>Hi !!&lt;BR /&gt;i have a problem,&lt;BR /&gt;running script manually is ok. but if i run it from cron i have an error:&lt;BR /&gt;&lt;BR /&gt;/home/scripts/test.sh[21]: Syntax error at line 56 : `else' is &lt;BR /&gt;not matched.                                                   &lt;BR /&gt;why?&lt;BR /&gt;&lt;BR /&gt;my script is:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/csh&lt;BR /&gt;set p_monit=/home/scripts/MONITORING&lt;BR /&gt;#---&amp;gt;12132005 This is to take correct name in script&lt;BR /&gt;cd /interface/Towers/exe/backup&lt;BR /&gt;set aa=`ls -l | grep earn | awk '{ print $NF }'`&lt;BR /&gt;set bb=`echo $aa | wc -w`&lt;BR /&gt;if ($bb == 1) then&lt;BR /&gt;mv $aa db.opo&lt;BR /&gt;chmod 775 db.opo&lt;BR /&gt;else&lt;BR /&gt;set mensaje=`cat $p_monit/mail_messages.txt | grep 01 | cut -d":" -f2`&lt;BR /&gt;echo $mensaje | mailx -s "01 ORANGE ALERT to Mexico" me@patito.com.mx&lt;BR /&gt;endif&lt;BR /&gt;&lt;BR /&gt;Thanks, Manuales.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 14 Dec 2005 16:15:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/if-sentence/m-p/3691283#M103293</guid>
      <dc:creator>Manuales</dc:creator>
      <dc:date>2005-12-14T16:15:50Z</dc:date>
    </item>
    <item>
      <title>Re: If sentence ..</title>
      <link>https://community.hpe.com/t5/operating-system-linux/if-sentence/m-p/3691284#M103294</link>
      <description>Hi Manuales:&lt;BR /&gt;&lt;BR /&gt;The 'cron' environment is quite sparse, containing:&lt;BR /&gt;&lt;BR /&gt;HOME=user's-home-directory&lt;BR /&gt;LOGNAME=user's-login-id&lt;BR /&gt;PATH=/usr/bin:/usr/sbin:.&lt;BR /&gt;SHELL=/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;That is, *any* variables that are usually in your profile or login file are *not* available unless you specifically include them.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 14 Dec 2005 16:27:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/if-sentence/m-p/3691284#M103294</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2005-12-14T16:27:20Z</dc:date>
    </item>
    <item>
      <title>Re: If sentence ..</title>
      <link>https://community.hpe.com/t5/operating-system-linux/if-sentence/m-p/3691285#M103295</link>
      <description>but problem is with if sentence, now i have this problem:&lt;BR /&gt;&lt;BR /&gt;/home/scripts/test.sh[21]: Syntax error at line 21 : `if' is  not matched&lt;BR /&gt;&lt;BR /&gt;Thanks, Manuales.</description>
      <pubDate>Wed, 14 Dec 2005 16:31:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/if-sentence/m-p/3691285#M103295</guid>
      <dc:creator>Manuales</dc:creator>
      <dc:date>2005-12-14T16:31:59Z</dc:date>
    </item>
    <item>
      <title>Re: If sentence ..</title>
      <link>https://community.hpe.com/t5/operating-system-linux/if-sentence/m-p/3691286#M103296</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;put su - user before the script in your crontab&lt;BR /&gt;&lt;BR /&gt;Regards</description>
      <pubDate>Wed, 14 Dec 2005 16:32:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/if-sentence/m-p/3691286#M103296</guid>
      <dc:creator>Oviwan</dc:creator>
      <dc:date>2005-12-14T16:32:14Z</dc:date>
    </item>
    <item>
      <title>Re: If sentence ..</title>
      <link>https://community.hpe.com/t5/operating-system-linux/if-sentence/m-p/3691287#M103297</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;put su - USERNAME in front the script in your crontab&lt;BR /&gt;&lt;BR /&gt;Regards</description>
      <pubDate>Wed, 14 Dec 2005 16:34:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/if-sentence/m-p/3691287#M103297</guid>
      <dc:creator>Oviwan</dc:creator>
      <dc:date>2005-12-14T16:34:24Z</dc:date>
    </item>
  </channel>
</rss>

