<?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!! in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/shell-script/m-p/3450523#M15607</link>
    <description>find /yourpath -size 0 -exec rm -f {} \;</description>
    <pubDate>Mon, 27 Dec 2004 00:07:30 GMT</pubDate>
    <dc:creator>NiCK_76</dc:creator>
    <dc:date>2004-12-27T00:07:30Z</dc:date>
    <item>
      <title>shell script!!</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-script/m-p/3450522#M15606</link>
      <description>hi all,&lt;BR /&gt;i want to write a shell script thats should check size of the given file name. if the file contains zero bytes, remove that file. so any one plz help me. thanks in advance.&lt;BR /&gt;ajay.</description>
      <pubDate>Sun, 26 Dec 2004 22:45:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-script/m-p/3450522#M15606</guid>
      <dc:creator>ajay_34</dc:creator>
      <dc:date>2004-12-26T22:45:31Z</dc:date>
    </item>
    <item>
      <title>Re: shell script!!</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-script/m-p/3450523#M15607</link>
      <description>find /yourpath -size 0 -exec rm -f {} \;</description>
      <pubDate>Mon, 27 Dec 2004 00:07:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-script/m-p/3450523#M15607</guid>
      <dc:creator>NiCK_76</dc:creator>
      <dc:date>2004-12-27T00:07:30Z</dc:date>
    </item>
    <item>
      <title>Re: shell script!!</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-script/m-p/3450524#M15608</link>
      <description>hi nick,&lt;BR /&gt;it helped me.thanks for your reply.but i want to use 'if' condition or 'test' command to check the file size and then it should remove the empty files. thanks and regards.&lt;BR /&gt;ajay</description>
      <pubDate>Mon, 27 Dec 2004 01:47:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-script/m-p/3450524#M15608</guid>
      <dc:creator>ajay_34</dc:creator>
      <dc:date>2004-12-27T01:47:03Z</dc:date>
    </item>
    <item>
      <title>Re: shell script!!</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-script/m-p/3450525#M15609</link>
      <description>try following command&lt;BR /&gt;find ./ -size 0 -exec rm -i {} \;</description>
      <pubDate>Mon, 27 Dec 2004 02:37:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-script/m-p/3450525#M15609</guid>
      <dc:creator>NiCK_76</dc:creator>
      <dc:date>2004-12-27T02:37:19Z</dc:date>
    </item>
    <item>
      <title>Re: shell script!!</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-script/m-p/3450526#M15610</link>
      <description>If you insist on using an if, -s is what comes closest to your demand. [ -s &lt;FILENAME&gt; ] checks if a file exists and is larger than 0. So you would have to delete all files that fail that test.&lt;/FILENAME&gt;</description>
      <pubDate>Mon, 27 Dec 2004 10:06:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-script/m-p/3450526#M15610</guid>
      <dc:creator>Georg Tresselt</dc:creator>
      <dc:date>2004-12-27T10:06:09Z</dc:date>
    </item>
    <item>
      <title>Re: shell script!!</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-script/m-p/3450527#M15611</link>
      <description>#!/bin/sh&lt;BR /&gt;File_List=`ls`&lt;BR /&gt;for File_Name in $File_List&lt;BR /&gt;do&lt;BR /&gt;        File_Size=`ls -ld $File_Name | awk '{ print $5}'`&lt;BR /&gt;        if [ $File_Size == 0 ] ; then&lt;BR /&gt;                echo $File_Name::$File_Size&lt;BR /&gt;                rm -i $File_Name&lt;BR /&gt;        fi&lt;BR /&gt;done</description>
      <pubDate>Thu, 30 Dec 2004 11:54:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-script/m-p/3450527#M15611</guid>
      <dc:creator>Deepak_22</dc:creator>
      <dc:date>2004-12-30T11:54:04Z</dc:date>
    </item>
    <item>
      <title>Re: shell script!!</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-script/m-p/3450528#M15612</link>
      <description>From the bash man page (man bash):&lt;BR /&gt;&lt;BR /&gt;Conditional  expressions  are  used  by the [[ compound command and the test and [ builtin commands to test file attributes and perform string and arithmetic comparisons.  &lt;BR /&gt;&lt;BR /&gt; -s file   ==&amp;gt; True if file exists and has a size greater than zero.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Ross&lt;BR /&gt;</description>
      <pubDate>Sat, 01 Jan 2005 11:08:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-script/m-p/3450528#M15612</guid>
      <dc:creator>Ross Minkov</dc:creator>
      <dc:date>2005-01-01T11:08:52Z</dc:date>
    </item>
    <item>
      <title>Re: shell script!!</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-script/m-p/3450529#M15613</link>
      <description>thanks deepak.this is the script what exactly i was looking for.&lt;BR /&gt;thanks to all who given me suggestions.&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;ajay</description>
      <pubDate>Sun, 02 Jan 2005 23:32:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-script/m-p/3450529#M15613</guid>
      <dc:creator>ajay_34</dc:creator>
      <dc:date>2005-01-02T23:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: shell script!!</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-script/m-p/3450530#M15614</link>
      <description>Georg and Ross actually gave you a better solution.&lt;BR /&gt;&lt;BR /&gt;If using bash, certainly [[/]] with '-s' is the fastest solution, but if you want multi-platform, it's not the best.&lt;BR /&gt;&lt;BR /&gt;The 'test' ([) application has the '-s' option as well, and it is fully multiplatform:&lt;BR /&gt;&lt;BR /&gt;if [ -s /file/name.here ]&lt;BR /&gt;then&lt;BR /&gt;rm -f /file/name.here&lt;BR /&gt;fi</description>
      <pubDate>Mon, 03 Jan 2005 18:47:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-script/m-p/3450530#M15614</guid>
      <dc:creator>Stuart Browne</dc:creator>
      <dc:date>2005-01-03T18:47:15Z</dc:date>
    </item>
    <item>
      <title>Re: shell script!!</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-script/m-p/3450531#M15615</link>
      <description>hi browne,&lt;BR /&gt;&lt;BR /&gt;i tryed your script but it dint work browne .y i dont know.it cant delete the empty file. anyway thanks.&lt;BR /&gt;&lt;BR /&gt;ajay</description>
      <pubDate>Sun, 09 Jan 2005 22:33:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-script/m-p/3450531#M15615</guid>
      <dc:creator>ajay_34</dc:creator>
      <dc:date>2005-01-09T22:33:01Z</dc:date>
    </item>
    <item>
      <title>Re: shell script!!</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-script/m-p/3450532#M15616</link>
      <description>&lt;BR /&gt;Ajay,&lt;BR /&gt;&lt;BR /&gt;Try this code below. I think Stewart missed one "!".&lt;BR /&gt;&lt;BR /&gt;==============================&lt;BR /&gt;#!/bin/bash&lt;BR /&gt;if [ ! -s emptyfile ]&lt;BR /&gt;then&lt;BR /&gt;   echo "deleting emptyfile"&lt;BR /&gt;   rm -f emptyfile&lt;BR /&gt;fi&lt;BR /&gt;===============================&lt;BR /&gt;&lt;BR /&gt;Again from the bash man page (man bash):&lt;BR /&gt;&lt;BR /&gt;Conditional expressions are used by the [[ compound command and the test and [ builtin commands to test file attributes and perform string and arithmetic comparisons. &lt;BR /&gt;&lt;BR /&gt;-s file ==&amp;gt; True if file exists and has a size greater than zero.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Ross</description>
      <pubDate>Sun, 09 Jan 2005 23:44:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-script/m-p/3450532#M15616</guid>
      <dc:creator>Ross Minkov</dc:creator>
      <dc:date>2005-01-09T23:44:14Z</dc:date>
    </item>
    <item>
      <title>Re: shell script!!</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-script/m-p/3450533#M15617</link>
      <description>yup, I screwed up, my apologies.</description>
      <pubDate>Mon, 10 Jan 2005 00:51:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-script/m-p/3450533#M15617</guid>
      <dc:creator>Stuart Browne</dc:creator>
      <dc:date>2005-01-10T00:51:37Z</dc:date>
    </item>
    <item>
      <title>Re: shell script!!</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-script/m-p/3450534#M15618</link>
      <description>hi Ross Minkov  and Stuart Browne,&lt;BR /&gt;thanks for your support. your suggestions helped me.slowly i am learning shell scripting.your suggestions helped me to think in different way.&lt;BR /&gt;&lt;BR /&gt;thanks once again &lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;ajay</description>
      <pubDate>Thu, 13 Jan 2005 20:28:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-script/m-p/3450534#M15618</guid>
      <dc:creator>ajay_34</dc:creator>
      <dc:date>2005-01-13T20:28:24Z</dc:date>
    </item>
  </channel>
</rss>

