<?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: batch file execution in Operating System - Tru64 Unix</title>
    <link>https://community.hpe.com/t5/operating-system-tru64-unix/batch-file-execution/m-p/5220317#M15329</link>
    <description>I used test -d instead of -s</description>
    <pubDate>Sun, 24 Jan 2010 07:44:11 GMT</pubDate>
    <dc:creator>fergani</dc:creator>
    <dc:date>2010-01-24T07:44:11Z</dc:date>
    <item>
      <title>batch file execution</title>
      <link>https://community.hpe.com/t5/operating-system-tru64-unix/batch-file-execution/m-p/5220308#M15320</link>
      <description>Hi everyone,&lt;BR /&gt;I create a batch file and also create file is called FAIMOS for database.&lt;BR /&gt;The batch file is executed automatically at start-up ,so I want it to be executed ONLY when the du of the FAIMOS is ZERO.&lt;BR /&gt;&lt;BR /&gt;What could I add to the batch file in order to meet my requirement?&lt;BR /&gt;I know only how to get the batch file executed at start-up.&lt;BR /&gt;bye.&lt;BR /&gt;</description>
      <pubDate>Wed, 20 Jan 2010 07:24:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-tru64-unix/batch-file-execution/m-p/5220308#M15320</guid>
      <dc:creator>fergani</dc:creator>
      <dc:date>2010-01-20T07:24:03Z</dc:date>
    </item>
    <item>
      <title>Re: batch file execution</title>
      <link>https://community.hpe.com/t5/operating-system-tru64-unix/batch-file-execution/m-p/5220309#M15321</link>
      <description>&lt;!--!*#--&gt;      man test&lt;BR /&gt;&lt;BR /&gt;Look for "-s".</description>
      <pubDate>Wed, 20 Jan 2010 07:53:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-tru64-unix/batch-file-execution/m-p/5220309#M15321</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2010-01-20T07:53:11Z</dc:date>
    </item>
    <item>
      <title>Re: batch file execution</title>
      <link>https://community.hpe.com/t5/operating-system-tru64-unix/batch-file-execution/m-p/5220310#M15322</link>
      <description>Hi &lt;BR /&gt;I have two directories the first one is called faimos and it has some data,&lt;BR /&gt;and the other is called fiims and it is empty.&lt;BR /&gt;&lt;BR /&gt;I made two batch files are called startup_1 and startup_2.&lt;BR /&gt;The first batch file (startup_1) is contained the following :-&lt;BR /&gt;-----------------------&lt;BR /&gt;vi startup_1&lt;BR /&gt;dir1=/faimos&lt;BR /&gt;if test -s "$dir1" then&lt;BR /&gt;echo the faimos directory has some data&lt;BR /&gt;fi&lt;BR /&gt;---------------------------&lt;BR /&gt;&lt;BR /&gt;And the second batch file is contained the following :-&lt;BR /&gt;----------------------------&lt;BR /&gt;vi startup_2&lt;BR /&gt;dir2=/fiims&lt;BR /&gt;if test -s "$dir2" then&lt;BR /&gt;echo the faimos directory is empty&lt;BR /&gt;fi&lt;BR /&gt;------------------------------&lt;BR /&gt;the results when I executed the first and the second batch file are shown bellow:-&lt;BR /&gt;&lt;BR /&gt;--------------------&lt;BR /&gt;sh startup_1&lt;BR /&gt;the faimos directory has some data&lt;BR /&gt;--------------------&lt;BR /&gt;sh startup_2&lt;BR /&gt;the faimos directory is empty&lt;BR /&gt;--------------------&lt;BR /&gt;I think the first result is true, but the second result is wrong the message should not be appeared because the fiims directory is empty and If statement return false. &lt;BR /&gt;&lt;BR /&gt;please could you help me to solve my problem?</description>
      <pubDate>Wed, 20 Jan 2010 13:19:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-tru64-unix/batch-file-execution/m-p/5220310#M15322</guid>
      <dc:creator>fergani</dc:creator>
      <dc:date>2010-01-20T13:19:24Z</dc:date>
    </item>
    <item>
      <title>Re: batch file execution</title>
      <link>https://community.hpe.com/t5/operating-system-tru64-unix/batch-file-execution/m-p/5220311#M15323</link>
      <description>&lt;!--!*#--&gt;&amp;gt; please could you help me to solve my&lt;BR /&gt;&amp;gt; problem?&lt;BR /&gt;&lt;BR /&gt;Perhaps, if you first decide what it is.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; [...] create file is called FAIMOS [...]&lt;BR /&gt;&lt;BR /&gt;&amp;gt; [...] two directories the first one is&lt;BR /&gt;&amp;gt; called faimos [...]&lt;BR /&gt;&lt;BR /&gt;If it's a file, then "test -s" should work.&lt;BR /&gt;If it's a directory, then you may need to do&lt;BR /&gt;more work.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; [...] when the du of the FAIMOS is ZERO.&lt;BR /&gt;&lt;BR /&gt;What, exactly, is the condition you wish to&lt;BR /&gt;test?  "du" says zero, or no files in the&lt;BR /&gt;directory, or what?&lt;BR /&gt;&lt;BR /&gt;urtx# mkdir empty_directory&lt;BR /&gt;urtx# du -k empty_directory&lt;BR /&gt;8       empty_directory&lt;BR /&gt;&lt;BR /&gt;It's not easy to get "du" to say zero.  Even&lt;BR /&gt;an empty directory occupies some disk space.&lt;BR /&gt;&lt;BR /&gt;urtx# mkdir non-empty_directory&lt;BR /&gt;urtx# echo fred &amp;gt; non-empty_directory/small_file&lt;BR /&gt;&lt;BR /&gt;urtx# ls -1A empty_directory&lt;BR /&gt;urtx# ls -1A non-empty_directory&lt;BR /&gt;small_file&lt;BR /&gt;&lt;BR /&gt;urtx# ls -1A empty_directory | wc -l&lt;BR /&gt;         0&lt;BR /&gt;urtx# ls -1A non-empty_directory | wc -l&lt;BR /&gt;         1&lt;BR /&gt;&lt;BR /&gt;urtx# find empty_directory&lt;BR /&gt;empty_directory&lt;BR /&gt;urtx# find non-empty_directory&lt;BR /&gt;non-empty_directory&lt;BR /&gt;non-empty_directory/small_file&lt;BR /&gt;&lt;BR /&gt;"wc -l" could count those, too.&lt;BR /&gt;&lt;BR /&gt;urtx# find empty_directory | grep '/'&lt;BR /&gt;urtx# echo $?&lt;BR /&gt;1&lt;BR /&gt;&lt;BR /&gt;urtx# find non-empty_directory | grep '/'&lt;BR /&gt;non-empty_directory/small_file&lt;BR /&gt;urtx# echo $?&lt;BR /&gt;0&lt;BR /&gt;&lt;BR /&gt;"grep -q" would be quieter:&lt;BR /&gt;&lt;BR /&gt;urtx# find empty_directory | grep -q '/'&lt;BR /&gt;urtx# echo $?&lt;BR /&gt;1&lt;BR /&gt;urtx# find non-empty_directory | grep -q '/'&lt;BR /&gt;urtx# echo $?&lt;BR /&gt;0&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;As usual, many things are possible.</description>
      <pubDate>Wed, 20 Jan 2010 14:10:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-tru64-unix/batch-file-execution/m-p/5220311#M15323</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2010-01-20T14:10:34Z</dc:date>
    </item>
    <item>
      <title>Re: batch file execution</title>
      <link>https://community.hpe.com/t5/operating-system-tru64-unix/batch-file-execution/m-p/5220312#M15324</link>
      <description>&lt;!--!*#--&gt;&amp;gt; if test -s "$dir1" then&lt;BR /&gt;&lt;BR /&gt;That works without a semi-colon?  I'd say:&lt;BR /&gt;&lt;BR /&gt;if test -s "$dir1"; then&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;dir1=/faimos&lt;BR /&gt;if test -s "$dir1" then&lt;BR /&gt;echo the faimos directory has some data&lt;BR /&gt;&lt;BR /&gt;dir2=/fiims&lt;BR /&gt;if test -s "$dir2" then&lt;BR /&gt;echo the faimos directory is empty&lt;BR /&gt;&lt;BR /&gt;This stuff is not magic.  Changing the&lt;BR /&gt;message does not change the meaning of&lt;BR /&gt;"test -s".  "test" does offer this:&lt;BR /&gt;&lt;BR /&gt;  !   Unary negation operator.&lt;BR /&gt;&lt;BR /&gt;and _that_ does work.</description>
      <pubDate>Wed, 20 Jan 2010 14:20:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-tru64-unix/batch-file-execution/m-p/5220312#M15324</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2010-01-20T14:20:14Z</dc:date>
    </item>
    <item>
      <title>Re: batch file execution</title>
      <link>https://community.hpe.com/t5/operating-system-tru64-unix/batch-file-execution/m-p/5220313#M15325</link>
      <description>Hi Steven Schweda,&lt;BR /&gt;&lt;BR /&gt;The condition I wish to&lt;BR /&gt;test?  "du" says zero in the&lt;BR /&gt;directory, pleas could you provide me with complete syntax for if statement.&lt;BR /&gt;&lt;BR /&gt;Bye.</description>
      <pubDate>Wed, 20 Jan 2010 17:41:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-tru64-unix/batch-file-execution/m-p/5220313#M15325</guid>
      <dc:creator>fergani</dc:creator>
      <dc:date>2010-01-20T17:41:59Z</dc:date>
    </item>
    <item>
      <title>Re: batch file execution</title>
      <link>https://community.hpe.com/t5/operating-system-tru64-unix/batch-file-execution/m-p/5220314#M15326</link>
      <description>&lt;!--!*#--&gt;&amp;gt; The condition I wish to&lt;BR /&gt;&amp;gt; test? "du" says zero in the&lt;BR /&gt;&amp;gt; directory&lt;BR /&gt;&lt;BR /&gt;Are you not reading this stuff?  As I've&lt;BR /&gt;showed, "du" does not say zero for an empty&lt;BR /&gt;directory.  Does your "du" work differently&lt;BR /&gt;from mine?&lt;BR /&gt;&lt;BR /&gt;&amp;gt; pleas could you provide me with complete&lt;BR /&gt;&amp;gt; syntax for if statement.&lt;BR /&gt;&lt;BR /&gt;You're not paying me enough to get me to do&lt;BR /&gt;your whole job for you.  I've already offered&lt;BR /&gt;a few different methods which should work.</description>
      <pubDate>Wed, 20 Jan 2010 19:16:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-tru64-unix/batch-file-execution/m-p/5220314#M15326</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2010-01-20T19:16:58Z</dc:date>
    </item>
    <item>
      <title>Re: batch file execution</title>
      <link>https://community.hpe.com/t5/operating-system-tru64-unix/batch-file-execution/m-p/5220315#M15327</link>
      <description>Hi Steven Schweda:- &lt;BR /&gt;You're not paying me enough to get me to do&lt;BR /&gt;your whole job for you.  &lt;BR /&gt;&lt;BR /&gt;The exact and the whole job I intend to do with described details is:-&lt;BR /&gt;&lt;BR /&gt;I create a batch file is called at_startup and also create a directory is called Faimos for database.&lt;BR /&gt;The batch file is executed automatically at start-up and contains the following:-&lt;BR /&gt;&lt;BR /&gt;vi at_startup&lt;BR /&gt;LOGFILE=/usr/backup/logfile; export LOGFILE&lt;BR /&gt;date &amp;gt;&amp;gt;$LOGFILE 2&amp;gt;&amp;gt;$LOGFILE&lt;BR /&gt;TAPE=/dev/ntape/tape0c&lt;BR /&gt;su - oracle -c /usr/backup/dbshut &amp;gt;&amp;gt;$LOGFILE 2&amp;gt;&amp;gt;$LOGFILE&lt;BR /&gt;cd /&lt;BR /&gt;tar -xvf $TAPE faimos&lt;BR /&gt;find /faimos -name '*.dump' -exec rm {} \;&lt;BR /&gt;su - oracle -c /usr/backup/dbstart &amp;gt;&amp;gt;$LOGFILE 2&amp;gt;&amp;gt;$LOGFILE&lt;BR /&gt;su - oracle -c "sqlplus system/manager @/alt_fa_user.sql"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;but I need this batch file to be executed only when Faimos directory is empty &lt;BR /&gt;&lt;BR /&gt;bye.</description>
      <pubDate>Thu, 21 Jan 2010 06:56:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-tru64-unix/batch-file-execution/m-p/5220315#M15327</guid>
      <dc:creator>fergani</dc:creator>
      <dc:date>2010-01-21T06:56:59Z</dc:date>
    </item>
    <item>
      <title>Re: batch file execution</title>
      <link>https://community.hpe.com/t5/operating-system-tru64-unix/batch-file-execution/m-p/5220316#M15328</link>
      <description>&lt;!--!*#--&gt;&amp;gt; [...] I've already offered&lt;BR /&gt;&amp;gt; a few different methods which should work.&lt;BR /&gt;&lt;BR /&gt;Still true.</description>
      <pubDate>Thu, 21 Jan 2010 07:52:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-tru64-unix/batch-file-execution/m-p/5220316#M15328</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2010-01-21T07:52:42Z</dc:date>
    </item>
    <item>
      <title>Re: batch file execution</title>
      <link>https://community.hpe.com/t5/operating-system-tru64-unix/batch-file-execution/m-p/5220317#M15329</link>
      <description>I used test -d instead of -s</description>
      <pubDate>Sun, 24 Jan 2010 07:44:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-tru64-unix/batch-file-execution/m-p/5220317#M15329</guid>
      <dc:creator>fergani</dc:creator>
      <dc:date>2010-01-24T07:44:11Z</dc:date>
    </item>
  </channel>
</rss>

