<?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: Shell script problem in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-problem/m-p/3059240#M908136</link>
    <description>The last line in the second script does not execute because of the exit right above it.&lt;BR /&gt;&lt;BR /&gt;Replace the exit with this&lt;BR /&gt;&lt;BR /&gt;EOF&lt;BR /&gt;&lt;BR /&gt;Then it will work.&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;. /u01/app/oracle/.profile&lt;BR /&gt;TODAY=`date +'D%y%m%d.T%H%M%S'`&lt;BR /&gt;ORACLE_HOME=/u01/app/oracle/product/9.2.0&lt;BR /&gt;PATH=$ORACLE_HOME/bin&lt;BR /&gt;ORACLE_SID=TTWB&lt;BR /&gt;/bin/mkdir /u29/backup/ARC"$TODAY"&lt;BR /&gt;/bin/chmod 755 /u29/backup/ARC$TODAY&lt;BR /&gt;ARC_FILE=/tmp/archive.$TODAY.lst&lt;BR /&gt;/usr/bin/compress /u25/arch/*&lt;BR /&gt;$PATH/sqlplus /nolog &amp;lt;&lt;EOF&gt;&lt;/EOF&gt;connect sys/ttwbsys as sysdba&lt;BR /&gt;archive log stop;&lt;BR /&gt;EOF&lt;BR /&gt;/bin/cp -R `/bin/cat $ARC_FILE` /u29/backup/ARC$TODAY &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;SEP</description>
    <pubDate>Thu, 28 Aug 2003 19:46:16 GMT</pubDate>
    <dc:creator>Steven E. Protter</dc:creator>
    <dc:date>2003-08-28T19:46:16Z</dc:date>
    <item>
      <title>Shell script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-problem/m-p/3059238#M908134</link>
      <description>I wrote the following script:&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;. /u01/app/oracle/.profile&lt;BR /&gt;TODAY=`date +'D%y%m%d.T%H%M%S'`&lt;BR /&gt;ORACLE_HOME=/u01/app/oracle/product/9.2.0&lt;BR /&gt;PATH=$ORACLE_HOME/bin&lt;BR /&gt;ORACLE_SID=TTWB&lt;BR /&gt;/bin/mkdir /u29/backup/ARC"$TODAY"&lt;BR /&gt;/bin/chmod 755 /u29/backup/ARC$TODAY&lt;BR /&gt;ARC_FILE=/tmp/archive.$TODAY.lst&lt;BR /&gt;/usr/bin/compress /u25/arch/*&lt;BR /&gt;$PATH/sqlplus /nolog &amp;lt;&lt;EOF&gt;&lt;/EOF&gt;connect  sys/ttwbsys as sysdba&lt;BR /&gt;archive log stop;&lt;BR /&gt;!/bin/cp -R `/bin/cat $ARC_FILE` /u29/backup/ARC$TODAY&lt;BR /&gt;&lt;BR /&gt;It gave the following error:&lt;BR /&gt;SQL*Plus: Release 9.2.0.1.0 - Production on Thu Aug 28 16:33:43 2003&lt;BR /&gt;&lt;BR /&gt;Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.&lt;BR /&gt;&lt;BR /&gt;SQL&amp;gt; Connected.&lt;BR /&gt;SQL&amp;gt; ORA-00250: archiver not started&lt;BR /&gt;SQL&amp;gt; then: then/endif not found.&lt;BR /&gt;Usage:  cp [-f|-i] [-p] [-S] [-e warn|force|ignore] source_file target_file&lt;BR /&gt;        cp [-f|-i] [-p] [-S] [-e warn|force|ignore] source_file ... target_directory&lt;BR /&gt;        cp [-f|-i] [-p] [-S] -R|-r [-e warn|force|ignore] source_directory ... target_directory&lt;BR /&gt;&lt;BR /&gt;SQL&amp;gt; Disconnected from Oracle9i Enterprise Edition Release 9.2.0.1.0 - 64bit Production&lt;BR /&gt;With the Partitioning option&lt;BR /&gt;JServer Release 9.2.0.1.0 - Production&lt;BR /&gt;&lt;BR /&gt;If I rewrite the script as follow:&lt;BR /&gt;&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;. /u01/app/oracle/.profile&lt;BR /&gt;TODAY=`date +'D%y%m%d.T%H%M%S'`&lt;BR /&gt;ORACLE_HOME=/u01/app/oracle/product/9.2.0&lt;BR /&gt;PATH=$ORACLE_HOME/bin&lt;BR /&gt;ORACLE_SID=TTWB&lt;BR /&gt;/bin/mkdir /u29/backup/ARC"$TODAY"&lt;BR /&gt;/bin/chmod 755 /u29/backup/ARC$TODAY&lt;BR /&gt;ARC_FILE=/tmp/archive.$TODAY.lst&lt;BR /&gt;/usr/bin/compress /u25/arch/*&lt;BR /&gt;$PATH/sqlplus /nolog &amp;lt;&lt;EOF&gt;&lt;/EOF&gt;connect  sys/ttwbsys as sysdba&lt;BR /&gt;archive log stop;&lt;BR /&gt;exit&lt;BR /&gt;/bin/cp -R `/bin/cat $ARC_FILE` /u29/backup/ARC$TODAY&lt;BR /&gt;&lt;BR /&gt;It does not do the last line at all. Help please.&lt;BR /&gt;</description>
      <pubDate>Thu, 28 Aug 2003 19:38:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-problem/m-p/3059238#M908134</guid>
      <dc:creator>Logan Ramasamy_1</dc:creator>
      <dc:date>2003-08-28T19:38:08Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-problem/m-p/3059239#M908135</link>
      <description>It doesn't do the last line because you have and "exit" as the next to the last line. When the script hits that exit command, it exits without further processing.</description>
      <pubDate>Thu, 28 Aug 2003 19:44:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-problem/m-p/3059239#M908135</guid>
      <dc:creator>John Dvorchak</dc:creator>
      <dc:date>2003-08-28T19:44:54Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-problem/m-p/3059240#M908136</link>
      <description>The last line in the second script does not execute because of the exit right above it.&lt;BR /&gt;&lt;BR /&gt;Replace the exit with this&lt;BR /&gt;&lt;BR /&gt;EOF&lt;BR /&gt;&lt;BR /&gt;Then it will work.&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;. /u01/app/oracle/.profile&lt;BR /&gt;TODAY=`date +'D%y%m%d.T%H%M%S'`&lt;BR /&gt;ORACLE_HOME=/u01/app/oracle/product/9.2.0&lt;BR /&gt;PATH=$ORACLE_HOME/bin&lt;BR /&gt;ORACLE_SID=TTWB&lt;BR /&gt;/bin/mkdir /u29/backup/ARC"$TODAY"&lt;BR /&gt;/bin/chmod 755 /u29/backup/ARC$TODAY&lt;BR /&gt;ARC_FILE=/tmp/archive.$TODAY.lst&lt;BR /&gt;/usr/bin/compress /u25/arch/*&lt;BR /&gt;$PATH/sqlplus /nolog &amp;lt;&lt;EOF&gt;&lt;/EOF&gt;connect sys/ttwbsys as sysdba&lt;BR /&gt;archive log stop;&lt;BR /&gt;EOF&lt;BR /&gt;/bin/cp -R `/bin/cat $ARC_FILE` /u29/backup/ARC$TODAY &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Thu, 28 Aug 2003 19:46:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-problem/m-p/3059240#M908136</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2003-08-28T19:46:16Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-problem/m-p/3059241#M908137</link>
      <description>Don't point my previous post.  Here is acorrected version.  Leave the exit alone.&lt;BR /&gt;&lt;BR /&gt;The last line in the second script does not execute because of the exit right above it.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Then it will work.&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;. /u01/app/oracle/.profile&lt;BR /&gt;TODAY=`date +'D%y%m%d.T%H%M%S'`&lt;BR /&gt;ORACLE_HOME=/u01/app/oracle/product/9.2.0&lt;BR /&gt;PATH=$ORACLE_HOME/bin&lt;BR /&gt;ORACLE_SID=TTWB&lt;BR /&gt;/bin/mkdir /u29/backup/ARC"$TODAY"&lt;BR /&gt;/bin/chmod 755 /u29/backup/ARC$TODAY&lt;BR /&gt;ARC_FILE=/tmp/archive.$TODAY.lst&lt;BR /&gt;/usr/bin/compress /u25/arch/*&lt;BR /&gt;$PATH/sqlplus /nolog &amp;lt;&lt;EOF&gt;&lt;/EOF&gt;connect sys/ttwbsys as sysdba&lt;BR /&gt;archive log stop;&lt;BR /&gt;exit;&lt;BR /&gt;EOF&lt;BR /&gt;/bin/cp -R `/bin/cat $ARC_FILE` /u29/backup/ARC$TODAY &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Thu, 28 Aug 2003 20:06:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-problem/m-p/3059241#M908137</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2003-08-28T20:06:09Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-problem/m-p/3059242#M908138</link>
      <description>Thanks SEP. exit and EOF worked perfectly. I ahve been struggling with this for a while. Hats off.</description>
      <pubDate>Fri, 29 Aug 2003 12:24:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-problem/m-p/3059242#M908138</guid>
      <dc:creator>Logan Ramasamy_1</dc:creator>
      <dc:date>2003-08-29T12:24:24Z</dc:date>
    </item>
  </channel>
</rss>

