 From : Michael Geary <Mike@GEARY.COM>                      2:332/417.2001  Mar 05 Set 95 17:30
 Subj : Re: How to delete files like C++.faq???

In article <82745.s9406255@mail.student.utwente.nl> "Remco Blaakmeer" <s9406255@
mail.student.utwente.nl> writes:

>>> How to delete files with "+" (plus sign) in their file names?

>Just try del c??.faq if you want to delete c++.faq. I haven't tried it
>because I had difficulties _creating_ a file with a + in its name, but I
>know it works with files that have spaces in their names. Unfortunately, if
>you have a file called cde.faq, it will also be deleted. So be careful as
>you always are when you use wildcards deleting files.

Here are a couple of terrific aliases that will eliminate wildcard worries:

del=`iff %_batch gt 0 .or. %_transient gt 0 then^
*del %&^else^*del /p %&^endiff`

copy=`iff %_batch gt 0 .or. %_transient gt 0 then^
*copy %&^else^*copy /r %&^endiff`

(Take out the line breaks, of course.)

These change DEL from the command line to DEL /P, and COPY from the command
line to COPY /R.  This prompts you on a delete and on a copy that replaces an
existing file.  Very handy for wildcards to make sure the command did what you
wanted.  You can always hit R at one of the prompts to skip the rest of the
prompting.

The %_batch and %_transient stuff makes DEL and COPY have their normal
behavior in a batch file or when called from a transient command shell, so the
aliases do not break batch files, makefiles, and the like.

-Mike

