Tell me about CygWin
July 4, 2004 12:28 AM Subscribe
Anyone here ever install CygWin on their machine? What are your experiences? [mi]
One thing that confuses me from the CygWin FAQ:
My Windows logon name has a space in it, will this cause problems?
Most definitely yes! UNIX shells (and thus Cygwin) use the space character as a word delimiter. Under certain circumstances, it is possible to get around this with various shell quoting mechanisms, but you are much better off if you can avoid the problem entirely.
In particular, the environment variables `USER' and `HOME' are set for you in /etc/profile. By default these derive from your Windows logon name. You may edit this file and set them explicitly to something without spaces.
(If you use the `login' package or anything else that reads /etc/passwd, you may need to make corresponding changes there. See the README file for that package.)
Well, I was already installed on an XP with a space-delimited-username, so I can't really change it now. Evidently, going by the FAQ, I'm supposed to adjust some of the CygWin config files -- to create a legal unix username. I find nothing in the files cited above. Thus, I'm at a lost and the FAQ doesn't elaborate. Moreover, the few programs I tried under CygWin seem to work find; accepting the double-word login name.
One thing that confuses me from the CygWin FAQ:
My Windows logon name has a space in it, will this cause problems?
Most definitely yes! UNIX shells (and thus Cygwin) use the space character as a word delimiter. Under certain circumstances, it is possible to get around this with various shell quoting mechanisms, but you are much better off if you can avoid the problem entirely.
In particular, the environment variables `USER' and `HOME' are set for you in /etc/profile. By default these derive from your Windows logon name. You may edit this file and set them explicitly to something without spaces.
(If you use the `login' package or anything else that reads /etc/passwd, you may need to make corresponding changes there. See the README file for that package.)
Well, I was already installed on an XP with a space-delimited-username, so I can't really change it now. Evidently, going by the FAQ, I'm supposed to adjust some of the CygWin config files -- to create a legal unix username. I find nothing in the files cited above. Thus, I'm at a lost and the FAQ doesn't elaborate. Moreover, the few programs I tried under CygWin seem to work find; accepting the double-word login name.
Response by poster: (Probably zeroed in on the word "shell" .. heh-eh)
Very nice answer (muchly appreciated) that sorta confirmed my suspicions. I, too, didn't see much use for the logon module. I must say, the 1/2 hour I've had to play around with it was sheer pleasure -- seeing my old friend "emacs" on a Windoze box. And since I'm prepping a full Linux box on my home network, the remote abilities you mentioned are something I'm looking forward to exploit. Also took a sudden recent fancy to learning Python. This should help greatly.
Thanx again!
posted by RavinDave at 1:56 AM on July 4, 2004
Very nice answer (muchly appreciated) that sorta confirmed my suspicions. I, too, didn't see much use for the logon module. I must say, the 1/2 hour I've had to play around with it was sheer pleasure -- seeing my old friend "emacs" on a Windoze box. And since I'm prepping a full Linux box on my home network, the remote abilities you mentioned are something I'm looking forward to exploit. Also took a sudden recent fancy to learning Python. This should help greatly.
Thanx again!
posted by RavinDave at 1:56 AM on July 4, 2004
I use cygwin extensively and as much as I like it I think it maybe overkill for most people. What do you want it for? Python for one works excellently as a native win32 app (and is much more useful than its cygwin sibling; and don't forget to get the win32all extensions!). If you are looking for a better command-line experience, there are a few native ports of unix utilities to Win32 (look for unix-utils I think, I've collected mine over many years) that IMHO integrate better with Windows.
The trouble with cygwin is that you have to know which parts of it are tied back to win32 and which are more unix-like. Dumb things like c: becoming /cygdrivec annoy me to this day...
posted by costas at 9:04 AM on July 4, 2004
The trouble with cygwin is that you have to know which parts of it are tied back to win32 and which are more unix-like. Dumb things like c: becoming /cygdrivec annoy me to this day...
posted by costas at 9:04 AM on July 4, 2004
Yeah, cygwin is great. The X server has come along nicely and in many ways is better than commercial offerings.
Don't sweat the space-in-username thing. It makes referring to $HOME a pain in the ass, but if you're only using Cygwin occasionally it won't be a big deal.
Do be careful to quote filenames when writing scripts, though. I mostly use Cygwin to do large manipulations of files, something you can't do easily in Windows. More than once I've forgotten to quote the filename in a for f in *; do blah blah $f; done and found I trashed a good part of my hard drive. Remember, 'Program Files' has a space in it.
posted by Nelson at 9:32 AM on July 4, 2004
Don't sweat the space-in-username thing. It makes referring to $HOME a pain in the ass, but if you're only using Cygwin occasionally it won't be a big deal.
Do be careful to quote filenames when writing scripts, though. I mostly use Cygwin to do large manipulations of files, something you can't do easily in Windows. More than once I've forgotten to quote the filename in a for f in *; do blah blah $f; done and found I trashed a good part of my hard drive. Remember, 'Program Files' has a space in it.
posted by Nelson at 9:32 AM on July 4, 2004
ravindave: see this to change your userid. I had problems with the space in my WinXP userid, but only when I tried to do things like install apache and twiki. This removed the problems and made alot of other tasks simpler.
costas: You can use the mount command to mount your c: drive to a more sane directory name. Here's my mount table:
posted by sleslie at 12:28 PM on July 4, 2004
costas: You can use the mount command to mount your c: drive to a more sane directory name. Here's my mount table:
$ mount c:\Program Files\Apache Group\Apache2 on /apache type system (binmode) c:\twiki on /twiki type system (binmode) c: on /c type system (binmode) d: on /d type system (binmode)
posted by sleslie at 12:28 PM on July 4, 2004
Response by poster: sleslie ... you just made my Christmas card list!
I was just coming here to moan that I had already been honked by CygWin when it tried to use my surname as an attribute. Felt discouraged, since everything else about it has impressed me.
Kudos to the other posters as well; I found much useful instruction here today.
posted by RavinDave at 1:34 PM on July 4, 2004
I was just coming here to moan that I had already been honked by CygWin when it tried to use my surname as an attribute. Felt discouraged, since everything else about it has impressed me.
Kudos to the other posters as well; I found much useful instruction here today.
posted by RavinDave at 1:34 PM on July 4, 2004
sleslie: yep, I am aware of that, but it's still un-win32-like. For one thing, their drive mapping will break any native win32 app. For example, I like using the win32 gvim, and launching gvim from cygwin is never reliable, especially if there are spaces or other non-unixy characters in the filename path.
What I've been looking for is a function to translate a cygwin path to a win32 path and vice versa (is there such a thing?) That would make cygwin much more palatable to me at least...
posted by costas at 4:27 PM on July 4, 2004
What I've been looking for is a function to translate a cygwin path to a win32 path and vice versa (is there such a thing?) That would make cygwin much more palatable to me at least...
posted by costas at 4:27 PM on July 4, 2004
cyg-wrapper.sh translates cygwin directory paths to something more palatable to windows. In my .bashrc, I have the following alias
When I type in "gvim ~/.bashrc", will run the command like so...
posted by sleslie at 8:42 PM on July 4, 2004
alias gvim='cyg-wrapper.sh "C:/Vim/vim62/gvim.exe" --binary-opt=-c,--cmd, -T,-t,--servername,--remote-send,--remote-expr --cyg-verbose --fork=2'which, as you see, calls the cyg-wrapper.sh script I have in my /home/$USER/bin directory.
When I type in "gvim ~/.bashrc", will run the command like so...
$ gvim ~/.bashrc C:/Vim/vim62/gvim.exe 'C:\cygwin\home\sleslie\.bashrc'
posted by sleslie at 8:42 PM on July 4, 2004
This thread is closed to new comments.
In answer to your main, more general question, I've installed Cygwin and I really like it. I currently use it mostly for the X server, which works wonderfully. It's nice to have applications running on a remote linux machine showing up in their own windows on my Win2000 PC, with taskbar buttons and everything. It's also a nice easy way to get Perl installed in windows, for example. Oh, and wget. And any other fun little utilities you can find in the Cygwin setup utility.
(By the way, nice job attracting the Google ads for fresh crab meat... ?)
posted by whatnotever at 1:44 AM on July 4, 2004