<?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 Need Help With ksh in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/need-help-with-ksh/m-p/2486313#M799409</link>
    <description>I am in the process of writing a korne shell script to accomplish the following:&lt;BR /&gt;&lt;BR /&gt;Start SQLLDR if datafile exists&lt;BR /&gt;Sleep 25 mins&lt;BR /&gt;wakes up&lt;BR /&gt;check for FLAG file&lt;BR /&gt;If found, archive/move data, log, error and flag files to archive directory, then quit.&lt;BR /&gt;If flag file not found, then return to sleep for 15 mins, try again.&lt;BR /&gt;&lt;BR /&gt;Keeping in mind that this is my first time using UNIX, I need to know if I'm at least on the right track.  Any assistance/guidance would be greatly appreciated.  Thanks.&lt;BR /&gt;&lt;BR /&gt;This is what I have so far:&lt;BR /&gt;&lt;BR /&gt;# ! /bin/ksh&lt;BR /&gt;export ORACLE_SID=XYZZ&lt;BR /&gt;export ORAENV_ASK=NO&lt;BR /&gt;. oraenv&lt;BR /&gt;&lt;BR /&gt;IF (DATA=abc) THEN&lt;BR /&gt;   sqlldr userid=xxx&lt;BR /&gt;   control=ccc.ctl&lt;BR /&gt;   bad=bbbb.bad&lt;BR /&gt;   discard=dddd.dsc&lt;BR /&gt;   log=llll.log&lt;BR /&gt;   sleep 600&lt;BR /&gt;   wake&lt;BR /&gt;&lt;BR /&gt;ELIF (DATA != abc)THEN&lt;BR /&gt;   sleep 1600&lt;BR /&gt;FI&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Wed, 24 Jan 2001 18:26:43 GMT</pubDate>
    <dc:creator>Louise Harrell</dc:creator>
    <dc:date>2001-01-24T18:26:43Z</dc:date>
    <item>
      <title>Need Help With ksh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-help-with-ksh/m-p/2486313#M799409</link>
      <description>I am in the process of writing a korne shell script to accomplish the following:&lt;BR /&gt;&lt;BR /&gt;Start SQLLDR if datafile exists&lt;BR /&gt;Sleep 25 mins&lt;BR /&gt;wakes up&lt;BR /&gt;check for FLAG file&lt;BR /&gt;If found, archive/move data, log, error and flag files to archive directory, then quit.&lt;BR /&gt;If flag file not found, then return to sleep for 15 mins, try again.&lt;BR /&gt;&lt;BR /&gt;Keeping in mind that this is my first time using UNIX, I need to know if I'm at least on the right track.  Any assistance/guidance would be greatly appreciated.  Thanks.&lt;BR /&gt;&lt;BR /&gt;This is what I have so far:&lt;BR /&gt;&lt;BR /&gt;# ! /bin/ksh&lt;BR /&gt;export ORACLE_SID=XYZZ&lt;BR /&gt;export ORAENV_ASK=NO&lt;BR /&gt;. oraenv&lt;BR /&gt;&lt;BR /&gt;IF (DATA=abc) THEN&lt;BR /&gt;   sqlldr userid=xxx&lt;BR /&gt;   control=ccc.ctl&lt;BR /&gt;   bad=bbbb.bad&lt;BR /&gt;   discard=dddd.dsc&lt;BR /&gt;   log=llll.log&lt;BR /&gt;   sleep 600&lt;BR /&gt;   wake&lt;BR /&gt;&lt;BR /&gt;ELIF (DATA != abc)THEN&lt;BR /&gt;   sleep 1600&lt;BR /&gt;FI&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 24 Jan 2001 18:26:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-help-with-ksh/m-p/2486313#M799409</guid>
      <dc:creator>Louise Harrell</dc:creator>
      <dc:date>2001-01-24T18:26:43Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help With ksh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-help-with-ksh/m-p/2486314#M799410</link>
      <description>Louise,&lt;BR /&gt;It looks like you're on the right track, but you don't need the 'wake' command, it'll wake on it's own.  Also, you can do 'else' rather than 'ELIF (DATA != abc)THEN'.&lt;BR /&gt;But you'll want to wrap the whole thing with a 'while' statement, otherwise it will just exit after sleeping.  What I do is like this:&lt;BR /&gt;Kntnu=0&lt;BR /&gt;while [ $Kntnu -eq 0 ]&lt;BR /&gt;do&lt;BR /&gt;...all your stuff in here ...&lt;BR /&gt;done&lt;BR /&gt;Also, you'll want to put quotes around your two variable assignments, ie &lt;BR /&gt;export ORACLE_SID="XYZZ"&lt;BR /&gt;Hope this helps,&lt;BR /&gt;Mo&lt;BR /&gt;</description>
      <pubDate>Wed, 24 Jan 2001 20:23:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-help-with-ksh/m-p/2486314#M799410</guid>
      <dc:creator>Maureen Gunkel</dc:creator>
      <dc:date>2001-01-24T20:23:02Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help With ksh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-help-with-ksh/m-p/2486315#M799411</link>
      <description>I agree with Maureen. One more thing you should check is the syntax of if then fi. The test should be performed in [] instead of (). so your if statement should look like :&lt;BR /&gt;if [ $DATA = "abc" ] &lt;BR /&gt;then &lt;BR /&gt;   something&lt;BR /&gt;elsif&lt;BR /&gt;   something&lt;BR /&gt;fi</description>
      <pubDate>Wed, 24 Jan 2001 20:48:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-help-with-ksh/m-p/2486315#M799411</guid>
      <dc:creator>Jitendra_1</dc:creator>
      <dc:date>2001-01-24T20:48:33Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help With ksh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-help-with-ksh/m-p/2486316#M799412</link>
      <description>Good point, Hemant. I missed the () [] part!&lt;BR /&gt;Mo</description>
      <pubDate>Wed, 24 Jan 2001 20:52:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-help-with-ksh/m-p/2486316#M799412</guid>
      <dc:creator>Maureen Gunkel</dc:creator>
      <dc:date>2001-01-24T20:52:02Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help With ksh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-help-with-ksh/m-p/2486317#M799413</link>
      <description>DATA is a variable and needs to be preceded with a $.  Beware, though, if it has not been assigned any value, the expression [ $DATA = "somestring" ] will generate an error.  It is better to make the test:&lt;BR /&gt;&lt;BR /&gt;if [ "$DATA" = "somestring" ]&lt;BR /&gt;then &lt;BR /&gt;   &lt;EXECUTE this=""&gt;&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;Enclosing $DATA in double quotes will allow a null value to be compared as a zero-length string.&lt;BR /&gt;&lt;/EXECUTE&gt;</description>
      <pubDate>Thu, 25 Jan 2001 03:11:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-help-with-ksh/m-p/2486317#M799413</guid>
      <dc:creator>Marc Veeneman</dc:creator>
      <dc:date>2001-01-25T03:11:56Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help With ksh</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-help-with-ksh/m-p/2486318#M799414</link>
      <description>... and use lowercase letters for keywords (if then else ...)</description>
      <pubDate>Thu, 25 Jan 2001 08:25:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-help-with-ksh/m-p/2486318#M799414</guid>
      <dc:creator>marc seguin</dc:creator>
      <dc:date>2001-01-25T08:25:11Z</dc:date>
    </item>
  </channel>
</rss>

