<?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: write if state for file size in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/write-if-state-for-file-size/m-p/4873372#M399138</link>
    <description>Hi&lt;BR /&gt;&lt;BR /&gt;if [ $(cat $FILE| wc -c ) - gt 99 ] ; then&lt;BR /&gt;.......</description>
    <pubDate>Wed, 01 Dec 2004 13:36:28 GMT</pubDate>
    <dc:creator>Victor Fridyev</dc:creator>
    <dc:date>2004-12-01T13:36:28Z</dc:date>
    <item>
      <title>write if state for file size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/write-if-state-for-file-size/m-p/4873368#M399134</link>
      <description>Is there a way to write an if state if file size is greater than 99?&lt;BR /&gt;&lt;BR /&gt;if [ file size &amp;gt; 99 ]&lt;BR /&gt;then&lt;BR /&gt;blah...</description>
      <pubDate>Wed, 01 Dec 2004 12:32:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/write-if-state-for-file-size/m-p/4873368#M399134</guid>
      <dc:creator>Ratzie</dc:creator>
      <dc:date>2004-12-01T12:32:37Z</dc:date>
    </item>
    <item>
      <title>Re: write if state for file size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/write-if-state-for-file-size/m-p/4873369#M399135</link>
      <description>How about using awk and ll?&lt;BR /&gt;&lt;BR /&gt;if `ll FILE | awk '{print $5}' -gt "99"`&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Wed, 01 Dec 2004 12:50:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/write-if-state-for-file-size/m-p/4873369#M399135</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2004-12-01T12:50:00Z</dc:date>
    </item>
    <item>
      <title>Re: write if state for file size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/write-if-state-for-file-size/m-p/4873370#M399136</link>
      <description>Yes, and no.&lt;BR /&gt;&lt;BR /&gt;No meaning that test options will not handle this.  I.E.&lt;BR /&gt;if [ -x myfile ] ; then&lt;BR /&gt;   echo "it's executable"&lt;BR /&gt;elif [ -w myfile ] ; then&lt;BR /&gt;   echo "it's writable"&lt;BR /&gt;fi&lt;BR /&gt;Man test for more information on built in testing.&lt;BR /&gt;&lt;BR /&gt;yes, you can make it work by grabbing the file size.&lt;BR /&gt;&lt;BR /&gt;_size=`ls -l myfile|awk '{print $5}'`&lt;BR /&gt;if [ "${_size}" -gt "1" ] ; 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;Similarly, this would work&lt;BR /&gt;&lt;BR /&gt;if [ `ls -l myfile | awk '{print $5}'` -gt 1 ] ; then&lt;BR /&gt;  # do something&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;If you do not like "-gt", then "&amp;gt;" does the same thing.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Shannon&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 01 Dec 2004 12:51:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/write-if-state-for-file-size/m-p/4873370#M399136</guid>
      <dc:creator>Shannon Petry</dc:creator>
      <dc:date>2004-12-01T12:51:48Z</dc:date>
    </item>
    <item>
      <title>Re: write if state for file size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/write-if-state-for-file-size/m-p/4873371#M399137</link>
      <description>Oops!&lt;BR /&gt;&lt;BR /&gt;if [ `ll FILE | awk '{print $5}'` -gt "99" ]&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Wed, 01 Dec 2004 12:54:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/write-if-state-for-file-size/m-p/4873371#M399137</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2004-12-01T12:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: write if state for file size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/write-if-state-for-file-size/m-p/4873372#M399138</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;if [ $(cat $FILE| wc -c ) - gt 99 ] ; then&lt;BR /&gt;.......</description>
      <pubDate>Wed, 01 Dec 2004 13:36:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/write-if-state-for-file-size/m-p/4873372#M399138</guid>
      <dc:creator>Victor Fridyev</dc:creator>
      <dc:date>2004-12-01T13:36:28Z</dc:date>
    </item>
    <item>
      <title>Re: write if state for file size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/write-if-state-for-file-size/m-p/4873373#M399139</link>
      <description>Answered works</description>
      <pubDate>Wed, 01 Dec 2004 14:09:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/write-if-state-for-file-size/m-p/4873373#M399139</guid>
      <dc:creator>Ratzie</dc:creator>
      <dc:date>2004-12-01T14:09:30Z</dc:date>
    </item>
  </channel>
</rss>

