Solved

unix to dos script conversion

Posted on 2004-03-31
5
642 Views
Last Modified: 2013-12-26
Hi guys,

What would be the equivalent of this unix command from a ksh script in a cmd script in DOS shell?

find . -type d -name blahblah -exec rm {} \;

Thanks!
0
Comment
Question by:vrungel
5 Comments
 
LVL 9

Accepted Solution

by:
Alf666 earned 250 total points
Comment Utility
Hemm.... Install Cygwin (all these tools under Win32). Much more powerfull than the DOS sh*t.

www.cygwin.com

You'll get a shell (bash, ksh, whatever, you name it), find if you want, the binutils ...etc.

Just for your information, Your find command is not optimal. It executes rm once per file found. You'd rather use the following :

find . -type d -name blahblah | xargs rm

xargs executes the fewest possible time the command you give as argument. It's only limit is the arguments stack size.
0
 
LVL 24

Expert Comment

by:fridom
Comment Utility
That's one good tip. The other is using a scripting language. But the script is broken, so it does not matter ;-)

Regards
Friedrich
0
 
LVL 9

Expert Comment

by:HamdyHassan
Comment Utility
vrungel:
Try VBScript script , check FileSystemObject
0
 
LVL 9

Expert Comment

by:HamdyHassan
Comment Utility
0
 

Author Comment

by:vrungel
Comment Utility
Thanks everyone, but I really needed to do it in DOS shell so the solution was

dir /s/b/ad blahblah > tempfile.txt
for /f  %f in (tempfile.txt) do del /s/f/q %f
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
substring method in java 1 79
Doc'in system (example?) BA 7 77
matchUp  challenge 6 48
Line meaning 9 74
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now