<?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: Test file size in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/test-file-size/m-p/2634028#M41933</link>
    <description>hi,&lt;BR /&gt;&lt;BR /&gt;You can use find -size n[c] try to read the man page of find.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Justo.</description>
    <pubDate>Thu, 20 Dec 2001 15:26:50 GMT</pubDate>
    <dc:creator>Justo Exposito</dc:creator>
    <dc:date>2001-12-20T15:26:50Z</dc:date>
    <item>
      <title>Test file size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/test-file-size/m-p/2634024#M41929</link>
      <description>G'day,&lt;BR /&gt;&lt;BR /&gt;I would like to test a file size.  If a file is equal to zero or 1 test would fail, and if a file was greater than 1 test would pass.  I know there was be an easy way to do this.   Thanks everyone for your help.</description>
      <pubDate>Thu, 20 Dec 2001 15:18:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/test-file-size/m-p/2634024#M41929</guid>
      <dc:creator>Adam Prince</dc:creator>
      <dc:date>2001-12-20T15:18:32Z</dc:date>
    </item>
    <item>
      <title>Re: Test file size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/test-file-size/m-p/2634025#M41930</link>
      <description>If I read your question right:&lt;BR /&gt;&lt;BR /&gt;NUM=`ll filename | awk '{print $7}'`&lt;BR /&gt;  if [ $NUM -gt 0 ]&lt;BR /&gt;    then&lt;BR /&gt;      exec command1&lt;BR /&gt;    else&lt;BR /&gt;      exec command2&lt;BR /&gt;   fi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;MC,&lt;BR /&gt;C</description>
      <pubDate>Thu, 20 Dec 2001 15:21:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/test-file-size/m-p/2634025#M41930</guid>
      <dc:creator>Craig Rants</dc:creator>
      <dc:date>2001-12-20T15:21:03Z</dc:date>
    </item>
    <item>
      <title>Re: Test file size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/test-file-size/m-p/2634026#M41931</link>
      <description>Ooops,&lt;BR /&gt;&lt;BR /&gt;NUM=`ll filename | awk '{print $7}'` &lt;BR /&gt;if [ $NUM -ge 1 ] &lt;BR /&gt;then &lt;BR /&gt;exec command1 &lt;BR /&gt;else &lt;BR /&gt;exec command2 &lt;BR /&gt;fi &lt;BR /&gt;&lt;BR /&gt;Notice the ge and 1, I did not read it right the first time...</description>
      <pubDate>Thu, 20 Dec 2001 15:22:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/test-file-size/m-p/2634026#M41931</guid>
      <dc:creator>Craig Rants</dc:creator>
      <dc:date>2001-12-20T15:22:22Z</dc:date>
    </item>
    <item>
      <title>Re: Test file size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/test-file-size/m-p/2634027#M41932</link>
      <description>Ok, last time&lt;BR /&gt;&lt;BR /&gt;NUM=`ll filename | awk '{print $7}'` &lt;BR /&gt;if [ $NUM -le 1 ] &lt;BR /&gt;then &lt;BR /&gt;exec command1 &lt;BR /&gt;else &lt;BR /&gt;exec command2 &lt;BR /&gt;fi &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;My short term memory is shot today.&lt;BR /&gt;&lt;BR /&gt;HH,&lt;BR /&gt;C</description>
      <pubDate>Thu, 20 Dec 2001 15:24:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/test-file-size/m-p/2634027#M41932</guid>
      <dc:creator>Craig Rants</dc:creator>
      <dc:date>2001-12-20T15:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: Test file size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/test-file-size/m-p/2634028#M41933</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;You can use find -size n[c] try to read the man page of find.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Justo.</description>
      <pubDate>Thu, 20 Dec 2001 15:26:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/test-file-size/m-p/2634028#M41933</guid>
      <dc:creator>Justo Exposito</dc:creator>
      <dc:date>2001-12-20T15:26:50Z</dc:date>
    </item>
    <item>
      <title>Re: Test file size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/test-file-size/m-p/2634029#M41934</link>
      <description>Thanks for the help Craig!&lt;BR /&gt;The routine looks like this:&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;NUM=`ls -l filename | awk '{print $5}'`&lt;BR /&gt;if [ "$NUM" -gt 1 ]&lt;BR /&gt;        then&lt;BR /&gt;        echo command1&lt;BR /&gt;        else&lt;BR /&gt;        echo command2&lt;BR /&gt;fi</description>
      <pubDate>Thu, 20 Dec 2001 15:38:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/test-file-size/m-p/2634029#M41934</guid>
      <dc:creator>Adam Prince</dc:creator>
      <dc:date>2001-12-20T15:38:56Z</dc:date>
    </item>
    <item>
      <title>Re: Test file size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/test-file-size/m-p/2634030#M41935</link>
      <description>Here's an easy way:&lt;BR /&gt;SIZE=`ls -l $YOURFILE|awk '{ print $5 }'`&lt;BR /&gt;if test "$SIZE" -gt "1"&lt;BR /&gt;then&lt;BR /&gt;        do something&lt;BR /&gt;else&lt;BR /&gt;        do something else&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;This will fail if the file doesn't exist, however.  To test if the file exists AND THEN&lt;BR /&gt;test to see if its size is larger than 1 byte:&lt;BR /&gt;if test -f YOURFILE&lt;BR /&gt;then&lt;BR /&gt;     insert the above script&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 21 Dec 2001 18:43:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/test-file-size/m-p/2634030#M41935</guid>
      <dc:creator>Chris Vail</dc:creator>
      <dc:date>2001-12-21T18:43:44Z</dc:date>
    </item>
    <item>
      <title>Re: Test file size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/test-file-size/m-p/2634031#M41936</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;You guys are doing it the hard way.&lt;BR /&gt;&lt;BR /&gt;How about &lt;BR /&gt;if [ -s myfile ]&lt;BR /&gt;  then&lt;BR /&gt;    echo "File exists and has a size greater 0"&lt;BR /&gt;  else&lt;BR /&gt;    echo "File does not exist"&lt;BR /&gt;  fi&lt;BR /&gt;&lt;BR /&gt;Clay</description>
      <pubDate>Fri, 21 Dec 2001 21:29:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/test-file-size/m-p/2634031#M41936</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2001-12-21T21:29:07Z</dc:date>
    </item>
    <item>
      <title>Re: Test file size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/test-file-size/m-p/2634032#M41937</link>
      <description>I'm with you Clay. The other script examples might be more useful if one were testing for a file of arbitrary size, but [ -s filename ] is much simpler.</description>
      <pubDate>Sat, 22 Dec 2001 00:10:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/test-file-size/m-p/2634032#M41937</guid>
      <dc:creator>Mark Fenton</dc:creator>
      <dc:date>2001-12-22T00:10:32Z</dc:date>
    </item>
    <item>
      <title>Re: Test file size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/test-file-size/m-p/2634033#M41938</link>
      <description>Hi all,&lt;BR /&gt;&lt;BR /&gt;Remember the question is whether the file size is greater than 1.  Thus, [ -s myfile ] is inadequate as it tests for greater than 0.&lt;BR /&gt;&lt;BR /&gt;:)&lt;BR /&gt;&lt;BR /&gt;Darrell</description>
      <pubDate>Sat, 22 Dec 2001 15:00:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/test-file-size/m-p/2634033#M41938</guid>
      <dc:creator>Darrell Allen</dc:creator>
      <dc:date>2001-12-22T15:00:40Z</dc:date>
    </item>
  </channel>
</rss>

