Cygwin : Java Glossary

Cygwin

CygWin (Cygnus Systems Windows) [latin for swan]. Primarily Cygwin is a way to run Linux BASH (Bourne Again Shell) scripts under Windows so that you can use the same scripting in both Linux and Windows. It contains a ton of other stuff including: Aspell spell checker, Bison, C++, curses, CVS, EMACS (Extensible Macro System), Grep, OpenSSL, Python, TROFF (Typesetting Runoff), SSH

Cygwin is a Linux-like environment for Windows. It consists of two parts: A DLL (Dynamic Link Library) (cygwin1.dll) which acts as a Linux emulation layer providing substantial Linux API (Application Programming Interface) functionality. A collection of tools, which provide Linux look and feel.

The Cygwin DLL works with all production versions of Windows since Windows 95, with the exception of Windows CE.

What Isn’t Cygwin?

Cygwin is not a way to run native Linux apps on Windows. You have to rebuild your application from source if you want to get it running on Windows. Cygwin is not a way to magically make native Windows apps aware of UNIX functionality, like signals, ptys, etc. Again, you need to build your apps from source if you want to take advantage of Cygwin functionality.

Installing

The package is so huge it takes hours to install. You cannot install it into X:\Program Files (x86)\cygwin. The original setup.exe you download is tiny however. It downloads just the pieces you need. When you are done put C:\cygwin\bin on the Windows path (which will also put in on the Bash $PATH) and set up a Windows association between *.sh, *.bsh and C:\cygwin\bin\bash.exe.

Cygwin contains its own link.exe. Depending on the path, you will get the Cygwin link.exe or the Microsoft link.exe

Using Bash

Here is how you let up an environment variable in an ordinary Windows *.bat, *.btm or *.cmd script:

Rem Set and echo an environment variable pointing to drive W:
set SSD=W:
echo %SSD%
rem display the path
path
rem display the current directory
cd
rem -30-

Here is how you do the same thing in a Bash *.bsh script:

# Set and echo an environment variable pointing to drive W:
export SSD=/cygdrive/w
echo $SSD
# display the path
echo $PATH
# display the current directory
pwd
# -30-

Cygwin prefers POSIX (Portable Operating System Interface for Unix) style file names in Bash Scripts, e.g. C:\temp\something.txt/cygdrive/c/temp/something.txt

Bash Scripts must use Unix (\n) line-ending conventions or you will get dozens of error message complaining about \r.
association
Cdrtools: burning CDs under Cygwin
Linux: to learn about Cygwin/Unix/Bash script commands

CMP homejump to top

available on the web at:

http://mindprod.com/jgloss/cygwin.html
  

optional Replicator mirror
of mindprod.com
on local hard disk J:

J:\mindprod\jgloss\cygwin.html
logo
Please email your , letters to the editor, errors, omissions, typos, formatting errors, ambiguities, unclear wording, broken/redirected link reports, suggestions to improve this page or comments to Roedy Green : feedback email. If you want your message, your name or email kept confidential, not considered for public posting, please explicitly specify that. Unless you state otherwise, I will treat your message as a letter to the editor that I may or may not publish in the feedback section. After that, it will be too late to retract it. If you disagree with something I said, especially when sending an ad-hominem attack, a rant composed mainly of obscenities or a death threat, please quote the offending passage and cite the web page where you found it, tell me why you think it is wrong, and, if possible, provide some supporting evidence. I can’t very well fix erroneous or ambiguous text if I can’t find it.
Blog
IP:[65.110.21.43]
Your face IP:[54.234.67.55]
You are visitor number 11,387.