Re: Scripting question - script to find and delete files

2002-07-12 Thread Saul Arias
On Fri, 2002-07-12 at 15:56, Joe Nestlerode wrote: > Thank you, that works beautifully. I modified it slightly to allow a > user to enter a search pattern on the command line, to wit: > > #!/bin/sh > > echo -e "Enter a file or pattern to search for...\n" > read file > > for i in `find . -name

Re: Scripting question - script to find and delete files

2002-07-12 Thread Joe Nestlerode
Saul, Thank you, that works beautifully. I modified it slightly to allow a user to enter a search pattern on the command line, to wit: #!/bin/sh echo -e "Enter a file or pattern to search for...\n" read file for i in `find . -name "$file"` do rm -i $i done exit 0 Thanks again! Joe [EMA

Re: Scripting question - script to find and delete files

2002-07-12 Thread Saul Arias
On Fri, 2002-07-12 at 13:13, Joe Nestlerode wrote: > I'm trying to write a simple script to search a directory tree for a > file pattern (specified as an argument with a wildcard, ie, testfile* or > *.jpg), and then delete matching files after first prompting the user > for a y/n. (yes=delete,

Scripting question - script to find and delete files

2002-07-12 Thread Joe Nestlerode
Hello, I'm trying to write a simple script to search a directory tree for a file pattern (specified as an argument with a wildcard, ie, testfile* or *.jpg), and then delete matching files after first prompting the user for a y/n. (yes=delete, no=don't delete, find the next match) The followin