Using bash instead of CMD?

Hey there!
I've been wondering now for some quite time, is it possible to use BASH unix shell instead of the original CMD in windows?

The problem is that CMD doesn't print special characters, and it would also solve the:
cin.get() problem.

Thanks in advance!
closed account (S6k9GNh0)
I'm not sure what your talking about. It's used all the time in bash... Almost every original command in linux was made in C.
There are several options for you.

One is Cygwin, which is a full POSIX environment.
http://www.cygwin.com/

Another is MSYS, which is a thin emulation layer at the shell level
http://www.mingw.org/wiki/msys

And if all you want is a simple bash shell, try one of the following:
http://win-bash.sourceforge.net/
http://www.steve.org.uk/Software/bash/

There is also zsh, which is a very good shell
http://www.zsh.org/

Hope this helps.

[edit] BTW, the shell has nothing to do with the characters you can display in the Windows console window. Google around "windows console replacement" for your options.

Also, the cin.get() problem has nothing to do with the shell. What you are looking for is unbuffered input from the terminal. See here for more: http://www.cplusplus.com/forum/articles/7312/
Last edited on
What I ment is (by defecualt) when you use <iostream> the cout print would appear in CMD, but I'm looking for a way to make c++ print it out to bash instead, so once I install Cygwin would that happen automatically ?
Regarding the cin.get() problem, thanks a lot for taking the time to answer that, and I also hope I'm not being a complete pain in the ass x)
(Ps. I'm a rather newb to C++)
- Thanks
The shell that gets attached to your executable depends on your system.

If you start your program from the bash prompt, then yes, the cout output will go to the bash display.

However, the Windows Console is not very good at displaying special characters without some heavy arm-twisting.
Topic archived. No new replies allowed.