fREWdiculous!
7 May
I work at a Microsoft Company more or less. We use SQL Server, IIS (moving to Apache…), and various flavors of Windows for all of our machines. I haven’t had the cojones to install Ubunutu on my desktop yet, so I am stuck with cygwin and friends. But the perl that runs my server is not in cygwin. That means that if I want to do valid testing I have to do it with the regular perl. I’ve tried running prove from the cygwin commandline, (ie, /cygdrive/c/usr/bin/perl/prove,) but it just hangs. So I just have to suck it up and run prove from cmd.
The color highlighting doesn’t work (or at least I couldn’t get it to) so with code that sometimes throws a lot of warnings (that’s intentional, I am testing croaks often) I see way too much noise to follow what’s going on. Redirection to the rescue! Instead of just running prove, I can run
1 | prove 2> foo |
instead and it redirects all of the warnings to the file foo. Although it’s obvious, it makes running tests that much easier, and I think running tests should really be the path of least resistance. So thank you DOS makers, for implementing STDERR redirection, I didn’t think you’d have done that, but you did.
One Response for "Making MSDOS a little bit nicer"
The Windows cmd shell has gotten pretty smart. It supports real pipelines too, from NT 4 onwards.
prove | perl filter.pl
Or even:
prove | find “search-term”
will work much as you’d expect them to on Unix.
If you really want to blow your mind, have a look at a book called “Windows NT Shell Scripting” by Tim Hill. Little things like calling functions in batch file library modules… whee!
Some of the syntax cmd.exe uses can get a little odd when you push it, but it’s not dumb like the old MSDOS COMMAND.COM used to be.
Leave a reply