I'm a Mac user and new to Windows. How can I execute a shell script in Windows?
Generally, I would save the text file with the extension .sh and run it via Terminal. But how could I do that in Windows?
|
I'm a Mac user and new to Windows. How can I execute a shell script in Windows? Generally, I would save the text file with the extension | |||||||||
feedback
|
This question came from our site for professional and enthusiast programmers.
|
Scripts with a Windows doesn't provide a Bourne-like shell. You can install Cygwin, which provides a Unix-like environment under Windows -- but it doesn't have a particularly "native" environment. (Editorial comment: Cygwin is great for people like me who need to use Windows but would really rather be using Unix.) There are other Unix-like subsystems that run under Windows, including MinGW and the Windows Services for UNIX package provided by Microsoft. Or, instead of trying to write and run Unix-like shell scripts, you can write Windows batch files. These generally have a There's also the relatively new Windows PowerShell; I'm not familiar with it myself, but I've heard good things about it. | |||||||
feedback
|
|
UWIN is a computer software package created by David Korn which allows programs written for the operating system Unix be built and run on Microsoft Windows with few, if any, changes. Some of the software development was subcontracted to Wipro, India. Check this UWIN - Unix for Windows Salient features of UWIN
Uses of UWIN
Drawbacks of UWIN
That software was used to teach us Linux Command when i was in college.. really good one.. Ref: WikiPedia Cygwin is a Unix-like environment and command-line interface for Microsoft Windows.
Interix
| ||||
|
feedback
|
|
On Win the common extensions are Cygwin is not a "must". It is just giving you the Linux style - use BASH on Win. | |||
|
feedback
|
|
You'll need CygWin, and then I believe you'll be able to just run:
| |||
|
feedback
|
|
The right answer was given in a comment by Kenaniah, you have to use batch files. You need to name your shell code file to *.bat, then you can run it by clicking it or simply type its name in the terminal. Notice that the windows terminal does not work exactly like the unix terminal. You will find much help and tutorials for the commands and syntax all over the web. There is also a possibility to use the Windows PowerShell, which seems to be more unix-like. | |||
|
feedback
|