Bash Shell Scripting in Windows?


Recommended Posts

Hello *nix customization and support!

I would like to write and execute bash shell scripts in Windows.. is this possible? And more specifically, I would like to use VI to do so. I have downloaded and installed Cygwin, but it comes with no VI editor.. actually, it seems to have come with almost nothing.

Anyways.. any help would be much appreciated. Thanks!

Link to comment
Share on other sites

www.vim.org << you'll find a windows version here

Cygwin provides an online installer as a download not all the Linux utilities, when you execute, it downloads and install everything you want, It might have Vim built in.

Link to comment
Share on other sites

vim is cross-platform so it runs on windows natively. As for shell scripting, I would use Python which is also cross-platform and also has the advantage of being able to be compiled into an executable on windows.

Link to comment
Share on other sites

I have downloaded and installed Cygwin, but it comes with no VI editor.. actually, it seems to have come with almost nothing.
Well yeah, if you do not install any packages -- its pretty bare ;)

Vim is one of the available editor packages.. there are lots to choose from.. If you want to use vi, then install it.

post-14624-1210519338_thumb.jpg

Link to comment
Share on other sites

Thanks guys! Yeah.. I missed that step with Cygwin when I installed.. whoops. Anyways.. seems to work great, I'm very happy, except... when I run my script it runs extremely slow.. it only utilizes 2% at most of my processor power and ends up taking 1-2 minutes to write a simple 40kb text file with only 8 lines of code. Does anyone know of a way to increase the processing power it utilizes?

Thanks again for the help guys!

Link to comment
Share on other sites

Thanks guys! Yeah.. I missed that step with Cygwin when I installed.. whoops. Anyways.. seems to work great, I'm very happy, except... when I run my script it runs extremely slow.. it only utilizes 2% at most of my processor power and ends up taking 1-2 minutes to write a simple 40kb text file with only 8 lines of code. Does anyone know of a way to increase the processing power it utilizes?

Thanks again for the help guys!

Generally, a program will run as fast as possible. Slowdowns are probably caused by IO waits. Do you do any network or disk interaction? If so, you'll have to look at optimizing those.

Link to comment
Share on other sites

Generally, a program will run as fast as possible. Slowdowns are probably caused by IO waits. Do you do any network or disk interaction? If so, you'll have to look at optimizing those.

Hmm.. its just a script that reads a field from a txt file and then appends that field with a little additional text to another text file. It loops about 1000-2000 times but still... I have a E8400 with 8GB RAM.. Oh well.. I suppose I'll have to try it on an actual linux installation to see if there is a difference.

Link to comment
Share on other sites

Like I already said, why are you using cygwin for such a task when there is a perfectly good and native solution: Python (or perl). And vim runs natively on windows too. So don't use cygwin...

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.