Simpler Navigation for Servers and Operating Systems
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
Operating System - Microsoft
cancel
Showing results for 
Search instead for 
Did you mean: 

sed and find under windows

Ralf Buchhold
Regular Advisor

sed and find under windows

Hello
i need the following (unix)script with dos
commands on a windows box

find * -exec sed "s/pattern/newpattern/g" {} \;

Thanks a lot
Ralf
5 REPLIES
Jon Finley
Honored Contributor

Re: sed and find under windows

Try using the MS-DOS port of SED:

http://www.student.northpark.edu/pemente/sed/

Jon
"Do or do not. There is no try!" - Yoda
Jon Finley
Honored Contributor

Re: sed and find under windows

Oh... You'll probably want to do a FOR statement... something like:

for /f %%i in ('DIR *.txt') do sed %%i "s/pattern/newpattern/g"

for /? will give you complete syntax.

Jon
"Do or do not. There is no try!" - Yoda
Stefan Schulz
Honored Contributor

Re: sed and find under windows

Hi Ralf,

there are some Unix utils available on Windows without the cygwin layer.

Have a look at:

http://www.weihenstephan.de/~syring/win32/UnxUtilsDist.html

Hope this helps

Regards Stefan
No Mouse found. System halted. Press Mousebutton to continue.
Stefan Schulz
Honored Contributor

Re: sed and find under windows

Sorry that was an old link. This one is more up to date:

http://unxutils.sourceforge.net/

Regards Stefan
No Mouse found. System halted. Press Mousebutton to continue.
Vibhor Kumar Agarwal
Esteemed Contributor

Re: sed and find under windows

Can't give you a link, but there are 2 utilities which i have used and will allow you to run unix command in windows.

One is already menitoned "Cygwin"
Other one is Software Environment for windows
something.
Vibhor Kumar Agarwal