Cygwin smuggles Unix shell commands into Windows

Daily Newsletters

Sign up to ZDNet UK's daily newsletter.

ANALYSIS
Software and hardware deployments within most IT shops don't usually occur all at once. For instance, IT managers may have worked out a strategy for deploying Windows 2000 servers coexisting with Windows 98 (and even a few Windows 95) boxes. Over time, Linux servers begin to show up as well as Web servers and application servers. This raises some interesting problems for both developers and IT consultants as they work with both these systems. A subtle problem can be seen in the use of shell scripts. As more IT shops move to mixed Windows and Linux environments, building and maintaining general utility scripts (still the mainstay of all maintenance and development programming for IT consultants) becomes a bigger headache. By using Red Hat Cygwin for Windows, you can create utility scripts that can power both your clients' Linux and Windows systems. What the shell does
The notion of a shell is very familiar to Unix and Linux developers but isn't necessarily as obvious to consultants using Windows, where the tools for development rely much more on graphical integrated-development environments (IDEs). A shell is a text interface with the kernel, providing a number of basic (and often not so basic) features from navigating directory structures to running applications to scheduling applications to run. In versions of Windows prior to Windows 2000, DOS was a shell application, while versions since then launch a Command Shell as a process under Win2K/XP. Shell scripts can be thought of as the invisible glue that holds together most IT shops. Consultants often write shell scripts to automate batch processes. For instance, a Web order form application may produce a purchase order (as binary data or, increasingly, as XML) that could be stored as a file or a database entry. While it's possible for the same Web process that created the file in the first place to also process this purchase order, this adds to the complexity (and hence both running time and maintainability) of the application. Instead, it's usually preferable to queue these messages in a directory or database and then periodically run a batch file that processes these messages. These batch processes are almost invariably scripts. Other scripts may periodically check logs to make sure no abnormal activity is happening (or to record information into logs in the first place), converting files from one format to another, archiving, or other activities. Shells under Linux
DOS (or the Windows NT Command Shell) came equipped with a small set of scripting utilities, but the language has long been of secondary concern to Microsoft; you're very limited in the kind of scripts you can write. On the other hand, Linux (and the variants of Unix) have developed a number of remarkably robust shells (from ash to zsh) that not only provide a number of rich Unix commands but also include histories, the ability to work with regular expression patterns, and very sophisticated data piping capabilities.

Post your comment

In order to post a comment you need to be registered and logged in.

You can also log in with Facebook. Log in or create your ZDNet UK account below

  • Login

Will not be displayed with your comment

By signing up for this service, you indicate that you agree to our Terms and Conditions and have read and understood our Privacy Policy. Questions about membership? Find the answers in the Community FAQ

Get ZDNet UK's daily newsletter

Enter your email address to sign up

ZDNet UK Live

songmaster

SHleG: Do you remember building a clockwork scorpion kit (I'm pretty sure I have a photo of it somewhere) — I think it was called something like...

15 minutes ago by songmaster on Software with everything
Chris Wortman

Good I love Yahoo! Their search engine is getting better than Google as of late. I find more of what I want on the first page, and usually within...

45 minutes ago by Chris Wortman via Facebook on Linux Mint 13 ramps up for KDE release
PatrickG

openhgs has made the point for Windows 8 multiple monitors without realising it! With Windows 7 you have to switch the mouse and so your focus...

3 hours ago by PatrickG on Windows 8 could speed multi-monitor uptake
Leslie Satenstein

Mozilla has threatened to stop supporting Linux. I guess that UBUNTU is going with another browser. I indicated that if Mozilla stops supporting...

4 hours ago by Leslie Satenstein via Facebook on Firefox rapid release improves Fedora Linux
Andy Bolstridge

Much as I abhor Microsoft's licensing practices, this is almost certainly down to purchasing IT equipment via 3rd party consultants - you get the...

4 hours ago by Andy Bolstridge via Facebook on 6 million wasted licences and £1,200 PCs: welcome to government IT
Jack Schofield

@openhgs Windows users have had multiple desktops since Linus started writing Linux. They just haven't shipped as standard because not enough...

21 hours ago by Jack Schofield on Windows 8 could speed multi-monitor uptake
Jack Schofield

@Phil at Cloud4 What, Microsoft gets £1,200 per PC and £1,622 per server? Gosh, I'm amazed....

21 hours ago by Jack Schofield on 6 million wasted licences and £1,200 PCs: welcome to government IT
craigsc

You guys have no idea what is going on at Autonomy. Autonomy could have been a much more profitable organization. The sales operations at Autonomy...

22 hours ago by craigsc on HP cuts 27,000 staff as Autonomy chief Lynch leaves
Moley

How does this impact on dual or multi booting? Seems to me to more or less prohibit this, from Windows 8 anyway. Will Grub 2 recognise Windows 8,...

22 hours ago by Moley on Windows 8 start-up speed forces USB boot workaround
apexwm

I don't understand why there cannot be a slight pause during the boot process so the user can press a key. Many operating systems do this, even if...

24 hours ago by apexwm on Windows 8 start-up speed forces USB boot workaround
Gavin Goodman

You can now buy the Xi3 modular computer in the UK at http://www.ocdistribution.com . This can be bought with the Tand3m software, pricing and...

1 day ago by Gavin Goodman on CES 2012: Xi3 microSERV3R
Phil at Cloud4

I agree: Mike Lynch can clearly build a business and manage strategy. I suspect the exit of Mike is more likely the end of a planned handover...

1 day ago by Phil at Cloud4 on HP cuts 27,000 staff as Autonomy chief Lynch leaves
Phil at Cloud4

This is unbeleivable government wastage with only one winner... Microsoft 1 - Tax payer Nil!

1 day ago by Phil at Cloud4 on 6 million wasted licences and £1,200 PCs: welcome to government IT
Mispam

So what do you do when you can't boot into windows? Why can't I just hold Shift while I power up instead of having to boot into windows and click a...

1 day ago by Mispam on Windows 8 start-up speed forces USB boot workaround
apexwm

I've also seen that Mac OS X for Intel machines is supposed to run in VirtualBox, which would also be a nice solution. I've never tried it though.

1 day ago by apexwm on xTreme Triple Booting: Linux, Mac & Windows
dave heasman

What I wonder is why when companies are caught bang to rights in not providing contracted services, people bend over to smear the customers? Surely...

1 day ago by dave heasman on Virgin throttles broadband for high-speed customers
pjc158

Strange statement from HP regarding Mike Lynch and not capable of scaling a company. Autonomy was a $7bn purchase which started as a small company...

1 day ago by pjc158 on HP cuts 27,000 staff as Autonomy chief Lynch leaves
lojolondon

Or - possibly, they will destroy business by ensuring people do not invest where there is no return. Another socialist idea, well beyond it's...

1 day ago by lojolondon on Open Data Institute will act as biz incubator
J.A. Watson

Good stuff Jake, very interesting. Thanks. jw

1 day ago by J.A. Watson on xTreme Triple Booting: Linux, Mac & Windows
openhgs

"the cost of a second LCD screen is about the same as one day of an office worker's time, so this should soon be recouped in extra productivity."...

1 day ago by openhgs on Windows 8 could speed multi-monitor uptake