<?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 question ..... regarding file size test in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-question-regarding-file-size-test/m-p/3354845#M712924</link>
    <description>Hi Daniel,&lt;BR /&gt;&lt;BR /&gt;Try:&lt;BR /&gt;&lt;BR /&gt;if [ -s /directsm/errors.txt ]&lt;BR /&gt;then&lt;BR /&gt;...&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Dave&lt;BR /&gt;</description>
    <pubDate>Wed, 11 Aug 2004 12:49:58 GMT</pubDate>
    <dc:creator>Dave Olker</dc:creator>
    <dc:date>2004-08-11T12:49:58Z</dc:date>
    <item>
      <title>shell script question ..... regarding file size test</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-question-regarding-file-size-test/m-p/3354843#M712922</link>
      <description>I am trying to test the size(greater than zero) of a file in "c" shell.(HPUX11)&lt;BR /&gt;If it is greater than zero bytes .... I want to send and email to abc ..... if it is zero bytes I want to email def.&lt;BR /&gt;Here is the test I am doing and I am getting a "if: Badly formed number." error and the script halts.&lt;BR /&gt;Can anyone tell me where I am going wrong?&lt;BR /&gt;&lt;BR /&gt;if (-s /directsm/errors.txt) then&lt;BR /&gt;elm -s EDI_ERROR abc@abc.com &amp;lt; /directsm/errors.txt&lt;BR /&gt;else    &lt;BR /&gt;elm -s $SHIPPERFILE def@abc.com &amp;lt; $TDFFILE&lt;BR /&gt;endif</description>
      <pubDate>Wed, 11 Aug 2004 12:43:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-question-regarding-file-size-test/m-p/3354843#M712922</guid>
      <dc:creator>Daniel Dumont_1</dc:creator>
      <dc:date>2004-08-11T12:43:03Z</dc:date>
    </item>
    <item>
      <title>Re: shell script question ..... regarding file size test</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-question-regarding-file-size-test/m-p/3354844#M712923</link>
      <description>I think it needs to be brackets and spaces so:&lt;BR /&gt;&lt;BR /&gt;if [ -s /directsm/errors.txt ]&lt;BR /&gt;</description>
      <pubDate>Wed, 11 Aug 2004 12:48:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-question-regarding-file-size-test/m-p/3354844#M712923</guid>
      <dc:creator>Kent Ostby</dc:creator>
      <dc:date>2004-08-11T12:48:11Z</dc:date>
    </item>
    <item>
      <title>Re: shell script question ..... regarding file size test</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-question-regarding-file-size-test/m-p/3354845#M712924</link>
      <description>Hi Daniel,&lt;BR /&gt;&lt;BR /&gt;Try:&lt;BR /&gt;&lt;BR /&gt;if [ -s /directsm/errors.txt ]&lt;BR /&gt;then&lt;BR /&gt;...&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Dave&lt;BR /&gt;</description>
      <pubDate>Wed, 11 Aug 2004 12:49:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-question-regarding-file-size-test/m-p/3354845#M712924</guid>
      <dc:creator>Dave Olker</dc:creator>
      <dc:date>2004-08-11T12:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: shell script question ..... regarding file size test</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-question-regarding-file-size-test/m-p/3354846#M712925</link>
      <description>csh is not as robust as ksh or posix sh. Is their a reason you are doing this in csh?&lt;BR /&gt; &lt;BR /&gt;The "-s" is not a valid csh selection. You could use "-z" to test for zero instead.&lt;BR /&gt; &lt;BR /&gt;if ( -z /directsm/errors.txt ) then&lt;BR /&gt; elm ...&lt;BR /&gt;else&lt;BR /&gt; elm ...&lt;BR /&gt;endif&lt;BR /&gt; &lt;BR /&gt;HTH&lt;BR /&gt; &lt;BR /&gt;-- Rod Hills &lt;BR /&gt;</description>
      <pubDate>Wed, 11 Aug 2004 13:16:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-question-regarding-file-size-test/m-p/3354846#M712925</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2004-08-11T13:16:32Z</dc:date>
    </item>
    <item>
      <title>Re: shell script question ..... regarding file size test</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-question-regarding-file-size-test/m-p/3354847#M712926</link>
      <description>Thanks Rodney ..... that solved the problem.&lt;BR /&gt;I was getting very strange errors trying to use the -s with the c shell.&lt;BR /&gt;Can I ask you where you found out that the -s was not valid with the c shell?</description>
      <pubDate>Wed, 11 Aug 2004 14:18:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-question-regarding-file-size-test/m-p/3354847#M712926</guid>
      <dc:creator>Daniel Dumont_1</dc:creator>
      <dc:date>2004-08-11T14:18:46Z</dc:date>
    </item>
    <item>
      <title>Re: shell script question ..... regarding file size test</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-question-regarding-file-size-test/m-p/3354848#M712927</link>
      <description>Do a "man csh" and look for section on "expressions". It lists what is allowed in a csh expresssion.&lt;BR /&gt; &lt;BR /&gt;HTH&lt;BR /&gt; &lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Wed, 11 Aug 2004 14:39:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-question-regarding-file-size-test/m-p/3354848#M712927</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2004-08-11T14:39:17Z</dc:date>
    </item>
  </channel>
</rss>

