hi all
i want to write unix shell script but my operating system is windows 7 so do you have or know a program that provide unix environment on windows???
thanks in advance

Recommended Answers

All 4 Replies

i try it but when it is download an error is displayed bin/bash directory is not exist

Get Virtual Box. Install it.
Get an ISO of a linux distro of your choice (i.e. linux mint, ubuntu server)
Create a new virtual machine within virtual box, mount the ISO to the virtual machine (in settings), and boot the virtual machine.

Write away.

Cygwin is basically what you want. It is exactly that, a unix-like terminal for Windows. It isn't perfect (but nearly so), and might give you a bit of trouble here and there, mostly if you didn't install the packages (in the manual install configurations) that you needed (and, as a beginner, you might not know what you need, so it's a bit of a catch 22). Cygwin is like a Linux-in-a-box program with a very rich set of packages that you can install (using their "setup.exe" program), almost as rich as some basic Linux distributions. With those packages, you can basically get just about every unix tool (including "bash", and much more), or more precisely, the GNU toolset (GNU implementations of classic Unix tools and more, as in "GNU/Linux" which means GNU-toolset + Linux-kernel, well, cygwin just replaces the "Linux-kernel" with "Windows-wrapped-in-a-POSIX-API"). Remember, the Unix "style" is that the overall system is composed of thousands of small programs (tools) each with a very specific task.

Anyway, if you had an error saying that "bin/bash" didn't exist, try checking the list of installed packages and make sure all "bash" related packages are installed ("bash" is not one of the default/minimal-install packages). In general, a package-rich install of cygwin should be able to meet all your unix shell scripting needs and much more.

Another option is, of course, to get Linux either in a virtual box (VirtualBox or VMWare), or as a dual-boot (a bit more of a commitment), or just trying it out with a live USB-key distribution. The virtual box option is the easiest and most convenient for casual use and to just play around with Linux distros and unix shell scripting. This will be less trouble to use than cygwin, but it is also heavier (on the system) and does create a fairly isolated environment that doesn't blend at all with the Windows environment. So, this might be a better solution if what you want is a sandbox in which to play with unix shell and with Linux. All my windows machines have a fairly package-rich cygwin installed on them, as it is the only decent and powerful command-line tool for working on the Windows system (not playing in a sandbox), so if that's your intended purpose, cygwin is what you need.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.