tags:

views:

42

answers:

3

Hi guys, how do I create a file and run a bash script in Windows XP command line? I only know commands in LINUX. :)

+3  A: 

Windows doesn't use the bash shell so therefore has no bash scripting. You could use Cygwin to run a virtual Linux environment within Windows.

What exactly are you trying to accomplish?

Bartek
I'm doing a Slony replication on two different servers (with databases,ofcourse), but with different OS [Ubuntu and WinXP]. The problem is, I have to run a slonik script on both servers to make the replication work. hmm.
Suezy
This is still a trial-and-error setup
Suezy
+1  A: 

I can think of at least 4 ways to create a file from the windows console. The most appropriate will depend on what you're doing and in what context.

You don't generally run bash scripts in windows. It's just not a bash shell. You run batch scripts, which is a completely different language, or PowerShell scripts (if it's installed). You can run a script with some bash commands if you take the time to install something like cygwin (which might be a good idea, given your background).

Joel Coehoorn
+1  A: 

Two ways to go.

If you want a quick light wieght solution install "Unix Shell Utilities" which features a bourne shell inplementation and most of the basic unix command line tools (sed , grep awk etc). This will work only if you have a simple script and use the command line tools in a very basic standard way.

Or as the other posters suggest install cygwin (this is a pretty major install!) which will give you a complete *nix environment on your PC, or "mingw" which is a stripped down cygwyn with just enough functionality to run the gcc compiler family but might be enough for your needs.

James Anderson
Link for unix utils is http://unxutils.sourceforge.net/
James Anderson