One of the bullet point features for Windows Vista Enterprize and Ultimate is the Unix subsystem for windows, which allows you to write posix... stuff? Anyway I'm outa my league talking about it... Anyone use this feature? Or explain it...
I know next to nothing about Unix programming.
It's probably best not to try to use the Posix subsystem for Windows. It was never really complete and is just a useless marketing tick box.
If you're truly interested in programming stuff for Unix, download one of the many Linux distributions (ie. Ubuntu) and VirtualBox. Install and start playing.
You might like Cygwin for having a Linux environment on your windows machine. Otherwise, definitely go for an isolated environment (virtual machines) like the others have suggested.
I don't want to discourage you from trying linux. But in this context it should be pointed out, that Linux is not completely posix compliant!
Wikipedia has a list of fully posix compliant operating systems
From that list, Solaris is probably the best to get started.
But anyway - for most of your posix-needs Linux should be the best choice (especially for beginners!)
The Posix subsystem in Windows is not only incomplete, but also slower in many cases than the "native" windows functions for the same thing. This is true for I/O for example.
In addition to Cygwin mentioned by another poster you should also consider MinGW.
Related
Is Cygwin considered robust and safe enough to be used on enterprise applications?
Do you know Enterprise applications that were developed or using Cygwin?
If you've been using cygwin - how often did you need support? Is there a fine-support for Cygwin? how well was the support you were given?
Thank you very much.
Why on earth would you even consider cygwin towards any sort of enterprise application? Even their site directly gives multiple signs it shouldn't be used for anything critical. You can't run native linux apps and you have to rebuild your app from source if you want it to run. It won't make your apps able to use any *nix functionality like signals, ptys, etc. All it is is a slim Linux type API layer....to answer your question, I don't think anyone would want to use cygwin in an enterprise application.
Like Maz asked, why wouldn't you just run linux? What potential benefits would you ever see coming from cygwin in an enterprise environment?
The best answer to your question may be obtained from the Cygwin web site. The answers obtained there come directly from the maintainers of the Cygwin DLL and ported software.
For a university course I have to write a http server which is supposed to run on both Linux and Windows.
I have got a humble Linux machine which I don't think can handle any kind of heavy virtual environment, neither I'm willing to go through the hassle of installing it.
This is the first project of mine complex enough (I estimate ~1.5 months to develop) to require an environment sufficiently comfortable to alternate rapidly between short coding and testing sessions (the latter on both platforms, of course).
So, I was wondering what could be the best set up for this situation. I think testing it on Wine would be ok (it is not a real-world thing, after all), and I installed MinGW for the Windows-targeting part.
Basically, a simple well-written makefile could solve my problem... It should build both the Linux and Windows binaries and place them in the respective folders (the Windows one in the Wine sub-tree) and I'm all done! But I feel very inexperienced in this thing and I really don't know where to start. Maybe the make manual, ahah!:)
Thoughts, suggestions, anything I didn't think/know!
Thank you!
(PS. I'm planning to use emacs as editor, or maybe learn vim. Unless eclipse provide some kind of skynet-like plugin that entirely solve this problem...:)
You're on the right track. It's not that complicated, really, thanks to MinGW. You basically need two things:
The code has to be portable across the OSes. MinGW has some POSIX support, but you'll probably need to either use Cygwin in order to be able to use the POSIX interface or have your own compatibility layer for interfacing with the OS. I'd probably go for Cygwin as then you can code only against POSIX and won't have to test and debug your compatibility layer. Also, make sure you won't use any external libraries that are OS specific. Non-portable code often results in a compile error, but make sure you test the application thoroughly anyway.
The toolchains for targeting Linux and Windows. You already have them, you just need to use them correctly. Normally you'd use a variable like $(CROSS_COMPILE) as a prefix when calling the toolchain during cross compilation. So when compiling for Linux, you call gcc, ld, etc. (having the CROSS_COMPILE variable empty), and when compiling for Windows you call e.g. i486-mingw32-gcc, i486-mingw32-ld etc., i.e. CROSS_COMPILE=i486-mingw32-. Or just just define CC, LD etc. depending on the target.
I wrote a small game on Linux and made it run on Windows as well. If you browse the code, you can see the code has next to no #ifdef jungle (basically just some extra debugging features enabled for Linux), and the Makefile is simple as well, with no complicated handling for cross-compilation, just the possibility to override CC etc. like it should be. As lots of important open source software is written this way (especially software that's used by the desktop and embedded devices), you should also be able to find lots of other examples on how to set up the build environment correctly.
As for testing the application on Windows, I think the best option is if you can find a real Windows machine somehow. If you do everything correctly, it should run the same as on Linux and you won't need to continuously test your application on both OSes. If testing on a Windows machine is not possible, a VM would be the next best choice, though it would probably be more difficult to set it up. Wine is a good backup plan, but I don't think you can be sure your application works well on Windows if you only tested it on Wine.
I work in a pseudo-IT team that does development outside of a formal IT development environment - using Windows XP (and IE6). I can't install any software myself, so can only use what the central IT department makes available - which isn't much.
I have lots of UNIX development experience, so it's painful working without some of the tools I have previously taken for granted.
Notepad is my favorite thing about Windows. What else is there hiding in C:\Windows that I should know about?
Not a great deal, if you're used to the plethora that comes with UNIX. The cmd.exe language has come a long way since the brain-dead version with MS-DOS. It's still no match for bash but it's not bad. Check out Rob Van der Woude's site ("Batch Files" link on the left side) for some fantastic little snippets.
I do know that findstr now does regular expressions so it's at least coming close to grep.
See also this question (which has a couple of answers from me and absolute bucketloads from everyone else) re Windows batch files.
A JavaScript interpreter: cscript / wscript (can also interpret VBScript plus any other language for which a Windows ScriptingHost compliant interpreter is installed)
WordPad: practically useless except for one thing: it can read Unix line endings, unlike NotePad
if you're lucky: PowerShell
Note that plenty of applications are also packaged as so-called portable applications which need no installation: Firefox, NotePad++, even a complete Ubuntu distribution.
ntsd (the Windows NT debugger for user-mode programs - command line stuff, a bit like gdb) was available by default on Windows installations in the system32 directory, although I think that this policy has changed since I can't find it in my Windows 7 64 bit installation.
mmm... not much indeed, besides I think everything that comes out of the box have already been mentioned...
not really answering your question, but I would recommend to use portable software, there's a huge collection of them available, like notepad++, winmerge, grepwin...
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
Linux utilities like sed, awk and other shell scripting features are awesome and life becomes a lot harder when I am developing on windows and cant use any of these.
People suggest to use cygwin for those who want the linux like tools under windows. But I feel cygwin will be an overkill for someone who only wants to use the handful commands.
Some say that Windows Services for Unix can also be a good alternative.
I have used none of these. Can some experienced programmer suggest best/simplest way to do this? of course apart from switching to linux itself.
I think the GnuWin32 project is exactly what you're looking for. Unix command line tools ported to Windows.
I've been using UnxUtils which are ports of common GNU utilities to native Win32 for ages.
I should add that I've also used Cygwin (et al.) and Microsoft's Services for Unix and neither of them were any good for me because they don't work as well as native versions from the command prompt, and using ksh/bash/whatever under Windows never really works right, even though I use ksh under unix all the time.
I tried something like this quite often, but to be honest, none of it really works well.
I therefore suggest using a virtual machine (such as VirtualBox) and install a small linux inside that. You can easily move files from and to the guest system with shared folders.
Judging by my experience, it is the best solution I used so far.
I tried Gow for some time, and it's nice. It offers 130 Unix-shell utilities for Windows. The contextual menu in the File explorer, to start a prompt in the current folder, is really handy.
There's a GNU port of many of the utils. I find that quite useful.
If you need Perl, I recommend Strawberry Perl.
The problem with most of the tools suggested here is that they don't get updated very often E.g. the last update GnuWin32 got was on 27 December 2010; UnxUtils was last updated on 01 March 2007.
I suggest MSYS2, a very good option which has a Win32 port of Arch's pacman package management system built-in. It's a spin-off from Cygwin like MSYS but much better than MSYS (lots of packages and gets updated almost daily) and (very light as opposed to) Cygwin.
It's a rolling release distribution that works under Windows and thus you get the latest and greatest of the packages. MSYS2 additionally has MinGW, provided in both x86 and x86_64 flavours. They've their own list of packages - MinGW packages.
Maintainers are very affable too.
MSYS is a common alternative for people who find CygWin excessive. It's still a special prompt, but it was originally intended to set up just enough Unix-compatibility to build programs using the MinGW compilers and the typical configure/make routine.
Using tools like sed and awk isn't going to work quite as expected in a normal Windows command prompt. It can be done to a point, but common usage involves command-line syntax that is normally interpreted by the shell, but which the Windows command prompt doesn't support. One example is wildcard file specifications. I've often found that Unix-centric tools aren't as usable on Windows as they assume the shell has expanded those wildcards into lists of files for them.
Install msysGit (netinstaller), it comes with a (msys/minGW) shell environment.
It also adds a "open shell here" in explorer.
It's faster than Cygwin, but at the sacrifice of unix compatibility.
Maybe it is stupid, but I usually search google for i.e.: "indent windows". You can select tools from mixed platforms. Lot of stuff from open systems has been ported on windows.
Are there any equivalents in the Windows world for patch stack management tools like Linux's quilt? I'm trying to come up with some development workflows for our environment, which need to work on both Linux and Windows. I can come up with a beautiful system for Linux using quilt and the like, but unless I can find a way to replicate it on Windows as well (including pretty GUI's for all the command-line-phobic developers), I'm basically stuck.
Maybe Mercurial's Queues can help? I do believe they work in the Windows implementation of Mercurial, too.
I use quilt on Windows by way of Cygwin.