views:

122

answers:

7

Linux utilities like sed, awk and other shell scripting features are awesome and life becomes a lot harder when I am developing on windows and cant use any of these.

People suggest to use cygwin for those who want the linux like tools under windows. But I feel cygwin will be an overkill for someone who only wants to use the handful commands.

Some say that Windows Services for Unix can also be a good alternative.

I have used none of these. Can some experienced programmer suggest best/simplest way to do this? of course apart from switching to linux itself.

+3  A: 

I think the GnuWin32 project is exactly what you're looking for. Unix command line tools ported to Windows.

mizipzor
This is working for me at the moment. I am also thankful to polemon's answer below which works well for exceptional situation.
Akshar Prabhu Desai
+3  A: 

There's a GNU port of many of the utils. I find that quite useful.

If you need Perl, I recommend Strawberry Perl.

Brian Rasmussen
+2  A: 

I've been using UnxUtils which are ports of common GNU utilities to native Win32 for ages.

I should add that I've also used Cygwin (et al.) and Microsoft's Services for Unix and neither of them were any good for me because they don't work as well as native versions from the command prompt, and using ksh/bash/whatever under Windows never really works right, even though I use ksh under unix all the time.

Richard Harrison
I use that too, very useful tool :)
James.Elsey
+3  A: 

I tried something like this quite often, but to be honest, none of it really works well.

I therefore suggest using a virtual machine (such as VirtualBox) and install a small linux inside that. You can easily move files from and to the guest system with shared folders.

Judging by my experience, it is the best solution I used so far.

polemon
+1. I do this, too.
gnucom
I forgot to mention, that you can assign *any* folder as shared folder, including your whole C drive or your working directory.With this, you can use your virtualized Linux as a shell and act upon those files in question.
polemon
What problems exactly did you encounter? I use GnuWin32 and have not had any real problems.
sleske
Oh this is really an interesting solution. I did try this out but dint know abotu the shared folder thing. I used a pen drive. :P So stupid of me.
Akshar Prabhu Desai
*None* of it works really well? I'm not so sure. I use Cygwin daily. It's the best thing to happen to Windows, since 32-bit protected mode, IMHO. Works great.
Dan Moulding
A: 

Install msysGit (netinstaller), it comes with a (msys/minGW) shell environment.

It also adds a "open shell here" in explorer.

It's faster than Cygwin, but at the sacrifice of unix compatibility.

Bob Fanger
+1  A: 

MSYS is a common alternative for people who find CygWin excessive. It's still a special prompt, but it was originally intended to set up just enough Unix-compatibility to build programs using the MinGW compilers and the typical configure/make routine.

Using tools like sed and awk isn't going to work quite as expected in a normal Windows command prompt. It can be done to a point, but common usage involves command-line syntax that is normally interpreted by the shell, but which the Windows command prompt doesn't support. One example is wildcard file specifications. I've often found that Unix-centric tools aren't as usable on Windows as they assume the shell has expanded those wildcards into lists of files for them.

Steve314
A: 

Maybe it is stupid, but I usually search google for i.e.: "indent windows". You can select tools from mixed platforms. Lot of stuff from open systems has been ported on windows.

Zozo