<?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: how to check whether a directory is empty? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-how-to-check-whether-a-directory-is-empty/m-p/2828875#M938063</link>
    <description>I am curious as the difference between the title of your post and the problem you describe therein.  Have you solved the problem described by the title?</description>
    <pubDate>Mon, 21 Oct 2002 07:39:56 GMT</pubDate>
    <dc:creator>Martin Robinson</dc:creator>
    <dc:date>2002-10-21T07:39:56Z</dc:date>
    <item>
      <title>Shell script: how to check whether a directory is empty?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-how-to-check-whether-a-directory-is-empty/m-p/2828873#M938061</link>
      <description>I'm writing a shell script that checks the read/write permission of a file. I encounter some problems of the if-else statement which consists of some syntax errors. What's wrong with my shell programming?&lt;BR /&gt;---------------&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;echo "Enter a file: \c"&lt;BR /&gt;read file&lt;BR /&gt;if [ -r "$file -a -w "$file" ]&lt;BR /&gt;   then&lt;BR /&gt;       echo "$file is readable and writable."&lt;BR /&gt;   elif [ -r "$file" -a ! -w "$file" ]&lt;BR /&gt;        then&lt;BR /&gt;            echo "$file is readable but not writable."&lt;BR /&gt;   else&lt;BR /&gt;       echo "$file is not readable and not writable"&lt;BR /&gt;fi&lt;BR /&gt;---------------&lt;BR /&gt;The script is supposed to read a file from user and then checks whether it is readable or writable. How do I correct my errors?&lt;BR /&gt;</description>
      <pubDate>Fri, 18 Oct 2002 13:24:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-how-to-check-whether-a-directory-is-empty/m-p/2828873#M938061</guid>
      <dc:creator>cybermilky</dc:creator>
      <dc:date>2002-10-18T13:24:33Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script: how to check whether a directory is empty?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-how-to-check-whether-a-directory-is-empty/m-p/2828874#M938062</link>
      <description>You're missing a double quote:&lt;BR /&gt;&lt;BR /&gt;if [ -r "$file -a -w "$file" ] &lt;BR /&gt;&lt;BR /&gt;S/B&lt;BR /&gt;&lt;BR /&gt;if [ -r "$file" -a -w "$file" ] &lt;BR /&gt;</description>
      <pubDate>Fri, 18 Oct 2002 13:38:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-how-to-check-whether-a-directory-is-empty/m-p/2828874#M938062</guid>
      <dc:creator>Tom Danzig</dc:creator>
      <dc:date>2002-10-18T13:38:49Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script: how to check whether a directory is empty?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-how-to-check-whether-a-directory-is-empty/m-p/2828875#M938063</link>
      <description>I am curious as the difference between the title of your post and the problem you describe therein.  Have you solved the problem described by the title?</description>
      <pubDate>Mon, 21 Oct 2002 07:39:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-how-to-check-whether-a-directory-is-empty/m-p/2828875#M938063</guid>
      <dc:creator>Martin Robinson</dc:creator>
      <dc:date>2002-10-21T07:39:56Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script: how to check whether a directory is empty?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-how-to-check-whether-a-directory-is-empty/m-p/2828876#M938064</link>
      <description>Martin,&lt;BR /&gt;The title of this post is the same as another post from cybermilky on the same day.  Must have forgotten to change the title on this one.&lt;BR /&gt;Theresa</description>
      <pubDate>Mon, 21 Oct 2002 11:00:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script-how-to-check-whether-a-directory-is-empty/m-p/2828876#M938064</guid>
      <dc:creator>Theresa Patrie</dc:creator>
      <dc:date>2002-10-21T11:00:15Z</dc:date>
    </item>
  </channel>
</rss>

