The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 04-22-2009
Calypso Calypso is offline
Registered User
  
 

Join Date: Apr 2009
Posts: 29
First of all thanks for the replies, the set of commands dont exactly do what i want though unfornutely
@radoulov
Is it possible to modify this slightly to ask the user first before deleting, I have been trying to play around with but cant figure out correct syntax

Code:
find $dir -name "*.txt" -exec echo "delete y/n" {} \; read x {} \;


@cfjohnson
this doesnt seem to search the correct directory, I found an example which will search the correct dir e.g.

Code:
for file in `find $dir -name "*.txt"`; do
The only problem is that some files have spaces in their names for example "/etc/space inFilename"

and then it prints the file out twice ie

/etc/space
inFilename

is there anyway to print it out as one?

Thanks again

Calypso