Sponsored Content
Top Forums Shell Programming and Scripting can you think of a better way? Post 14969 by kristy on Friday 8th of February 2002 11:03:36 AM
Old 02-08-2002
can you think of a better way?

Hi folks,

I've been tasked with cleaning up some directories. A list will be provided to me that will contain the names of the files to be deleted. I'm probably looking at columnar format, so that makes life easier. The files will be contained in two or three subdirectories of a directory.

This is what I have been testing:

for A in `cat $LIST;
do
{
find . -name $A -exec rm {} \;
};
done

it works, but I wonder if there is a better way?
ideas?
-kristy
 
list directory(1m)														list directory(1m)

NAME
list directory - Displays a list of all the directories whose names match the specified directory name SYNOPSIS
cdscp list directory directory-name [with attribute-name = attribute-value] ARGUMENTS
The full name of a specific directory. The last simple name can contain wildcard characters. The name of a particular attribute. The value of a particular attribute. DESCRIPTION
The list directory command displays a list of all the directories whose names match the specified directory name. The last simple name can contain wildcards. You can use a with attribute-name = attribute-value clause to limit output only to directories whose attributes have values equal to the specified values. A space must precede and follow the = (equals sign). Privilege Required You must have read permission to the parent directory. If you use a with attribute-name = attribute-value clause in the command, you also need read or test permission to the selected directories. NOTE
This command is replaced at Revision 1.1 by the dcecp command and may not be provided in future releases of DCE. EXAMPLE
The following command displays the names of all the directories in the /.:/sales directory: cdscp> list directory /.:/sales/* LIST DIRECTORY /.../abc.com/sales AT 1991-10-15-15:43:58 atlanta austin boston chicago ontario ny seattle RELATED INFORMATION
Commands: add directory(1m), create directory(1m), delete directory(1m), remove directory(1m), set directory(1m), set directory to skulk(1m), show directory(1m) list directory(1m)
All times are GMT -4. The time now is 03:55 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy