[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
find generates spurious error message
From: |
Paul Almquist |
Subject: |
find generates spurious error message |
Date: |
Mon, 18 Nov 2002 15:19:15 -0600 |
User-agent: |
KMail/1.4.1 |
Here is a script that says is all:
#------------------------- cut here -----------------------------------
#!/bin/bash
# Complaint: find generating spurious error message when removings
# empty directory.
#
# This problem is reproducible as illustrated below.
#
# This error message misleads the user into thinking
# that something did not work correctly so debugging
# was done only to discover that the messages is false.
# Now that I have resolved this issue I vaguely remember
# going thru this some time ago. No doubt others have
# as well. Please fix so none else has to repeat this.
#
# Using:
# find --version reports:
# GNU find version 4.1.7
#
# rmdir --version reports:
# rmdir (fileutils) 4.1
# Written by David MacKenzie.
#
# Running on RedHat Linux 7.3
# kernel: 2.4.18-3
clear
mkdir -p /tmp/dir/subdir1/subdir2
echo "Before - test case as reported by 'tree'"
tree /tmp/dir
echo "Note that /tmp/dir/subdir1/subdir2 exists"
echo
echo "directories as find reports them"
find /tmp/dir -type d
echo
echo "now removing empty directory"
find /tmp/dir -type d -exec rmdir --ignore-fail-on-non-empty {} \;
echo
echo "note above error message regarding 'subdir2' but the directory was found
and removed"
echo
echo "After - test case as reported by 'tree'"
echo "Note that /tmp/dir/subdir1/subdir2 no longer exists"
tree /tmp/dir
echo
echo "directories as find reports them"
find /tmp/dir -type d
# -- cleanup
rmdir /tmp/dir/subdir1 /tmp/dir
echo
#------------------------- cut here -----------------------------------
paul
--
Paul F. Almquist
CIS/CNS Instructor
Unix/Linux specialist
Chippewa Valley Technical College
address@hidden
- find generates spurious error message,
Paul Almquist <=