⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 how-using.texinfo

📁 cygwin, 著名的在win32下模拟unix操作系统的东东
💻 TEXINFO
📖 第 1 页 / 共 2 页
字号:
@section Using Cygwin@subsection Why can't my application locate cygncurses5.dll?  or cygintl.dll?  or cygreadline5.dll?  or ...?If you upgraded recently, and suddenly vim (or some other Cygwinapplication) cannot find @code{cygncurses5.dll}, it means that you didnot follow these instructions properly:@file{http://cygwin.com/ml/cygwin-announce/2001/msg00124.html}.  Torepair the damage, you must run Cygwin Setup again, and re-install the@samp{libncurses5} package.Note that Cygwin Setup won't show this option by default.  In the``Select packages to install'' dialogue, click on the @samp{Full/Part}button.  This lists all packages, even those that are alreadyinstalled.  Scroll down to locate the @samp{libncurses5} package.Click on the ``cycle'' glyph until it says ``Reinstall''.  Continuewith the installation.Similarly, if something cannot find @code{cygintl.dll}, then runCygwin Setup and re-install the @samp{libintl} and @samp{libintl1}packages.For a detailed explanation of the general problem, and how to extendit to other missing DLLs (like cygreadline5.dll) and identify theircontaining packages, see@file{http://cygwin.com/ml/cygwin/2002-01/msg01619.html}.@subsection Why is Cygwin suddenly @emph{so} slow?If you recently upgraded the @samp{cygwin} package and suddenly@emph{every} command takes a @emph{very} long time, then you probablyhave the obsolete @code{//c} notation in your PATH.  This now meansthe @emph{network share} @code{c}, which will slow things downtremendously if it does not exist.  See then next FAQ entry.@subsection Why doesn't //c (for C:) work anymore?(Similarly for any drive letter, e.g. @code{//z} for @code{Z:})This ``feature'' has long been deprecated, and no longer works at allin the latest release.  As of release 1.3.3, @code{//c} now means the@emph{network share} @code{c}.For a detailed discussion of why this change was made, and how dealwith it now, refer to@file{http://sources.redhat.com/ml/cygwin/2001-09/msg00014.html}.@subsection How should I set my PATH?This is done for you in the file /etc/profile, which is sourced by bashwhen you start it from the Desktop or Start Menu shortcut, created by@code{setup.exe}.  The line is@example	PATH="/usr/local/bin:/usr/bin:/bin:$PATH"@end exampleEffectively, this @strong{prepends} /usr/local/bin and /usr/bin to yourWindows system path.  If you choose to reset your PATH, say in$HOME/.bashrc, or by editing etc/profile directly, then you shouldfollow this rule.  You @strong{must} have @code{/usr/bin} in your PATH@strong{before} any Windows system directories.  (And you must not omitthe Windows system directories!)  Otherwise you will likely encounterall sorts of problems running Cygwin applications.@subsection Bash says "command not found", but it's right there!If you compile a program, you might find that you can't run it:@example	bash$ gcc -o hello hello.c        bash$ hello        bash: hello: command not found@end exampleUnlike Windows, bash does not look for programs in @samp{.} (the currentdirectory) by default.  You can add @samp{.} to your PATH (see above),but this is not recommended (at least on UNIX) for security reasons.Just tell bash where to find it, when you type it on the command line:@example	bash$ gcc -o hello hello.c        bash$ ./hello        Hello World!@end example@subsection How do I convert between Windows and UNIX paths?Use the 'cygpath' utility.  Type '@code{cygpath --help}' forinformation.  For example (on my installation):@example	bash$ cygpath --windows ~/.bashrc        D:\starksb\.bashrc        bash$ cygpath --unix C:/cygwin/bin/cygwin.bat        /usr/bin/cygwin.bat        bash$ cygpath --unix C:\\cygwin\\bin\\cygwin.bat        /usr/bin/cygwin.bat@end exampleNote that bash interprets the backslash '\' as an escape character, soyou must type it twice in the bash shell if you want it to be recognizedas such.@subsection Why doesn't bash read my .bashrc file on startup?Your .bashrc is read from your home directory specified by the HOMEenvironment variable.  It uses /.bashrc if HOME is not set.  So you needto set HOME correctly, or move your .bashrc to the top of the drivemounted as / in Cygwin.@subsection How can I get bash filename completion to be case insensitive?Add the following to your @code{~/.bashrc} file:@example	shopt -s nocaseglob@end exampleand add the following to your @code{~/.inputrc} file:@example	set completion-ignore-case on@end example@subsection Can I use paths/filenames containing spaces in them?Cygwin does support spaces in filenames and paths.  That said, someutilities that use the library may not, since files don't typicallycontain spaces in Unix.  If you stumble into problems with this, youwill need to either fix the utilities or stop using spaces in filenamesused by Cygwin tools.In particular, bash interprets space as a word separator.  You would haveto quote a filename containing spaces, or escape the space character.For example:@example	bash-2.03$ cd '/cygdrive/c/Program Files'@end exampleor@example	bash-2.03$ cd /cygdrive/c/Program\ Files@end example@subsection Why can't I cd into a shortcut to a directory?This is only valid up to but not including version 1.3.0:Cygwin does not follow MS Windows Explorer Shortcuts (*.lnk files).  Itsees a shortcut as a regular file and this you cannot "cd" into it.Some people have suggested replacing the current symbolic link schemewith shortcuts.  The major problem with this is that .LNK files wouldthen be used to symlink Cygwin paths that may or may not be validunder native Win32 non-Cygwin applications such as Explorer.Since version 1.3.0, Cygwin treats shortcuts as symlinks.@subsection I'm having basic problems with find.  Why?Make sure you are using the find that came with Cygwin and that youaren't picking up the Win32 find command instead.  You can verify thatyou are getting the right one by doing a "type find" in bash.If the path argument to find, including current directory (default), isitself a symbolic link, then find will not traverse it unless youspecify the @samp{-follow} option.  This behavior is different than mostother UNIX implementations, but is not likely to change.@subsection Where is the @samp{su} command?The @samp{su} command is not ported to Cygwin, so it is no longerprovided in the distribution.  You may be able to use @samp{login}instead, but you should read@file{http://www.cygwin.com/ml/cygwin/2001-03/msg00337.html} first.If you have a copy of su, then it's from an old Cygwin distribution, andit probably doesn't work properly anyway.@subsection Why doesn't man (or apropos) work?Even after installing the @samp{man} package, you get an error like this:@example	bash-2.04$ man man	Error executing formatting or display command.	System command (cd /usr/man ; (echo -e ".pl 1100i"; cat /usr/man/man1/man.1; echo ".pl \n(nlu+10") | /usr/bin/tbl | /usr/bin/groff -Tascii -mandoc | less -is) exited with status 32512.	No manual entry for man@end exampleYou also need /bin/sh, which is found in the @samp{ash} package.You must install this too.In addition, before you can use @samp{man -k} or @samp{apropos}, youmust create the whatis database.  Just run the command@example	/usr/sbin/makewhatis@end example(it may take a minute to complete).@subsection Why doesn't chmod work?@samp{ntsec} will allow UNIX permissions in Windows NT on NTFS filesystems.  This is on by default (a recent change).@samp{ntea} works on NTFS @emph{and} FAT but it creates a huge,@strong{undeletable} file on FAT filesystems.(The @samp{ntsec} and @samp{ntea} settings are values for the@samp{CYGWIN} environment variable.  See the Cygwin User's Guide at@file{http://cygwin.com/cygwin-ug-net/cygwin-ug-net.html} for moreinformation on this variable and its settings.)There is no solution at all for Windows 9x.If you have an application that requires a certain permission mode on afile, you may be able to work around this requirement by modifying theapplication's source code.  For a hint, based on work done by CorinnaVinschen for OpenSSH, see this message from the cygwin mailing list:@file{http://cygwin.com/ml/cygwin/2000-11/msg01176.html}.@subsection Why doesn't @samp{mkdir -p} work on a network share?Unfortunately, you cannot do something like this:@examplebash$ mkdir -p //MACHINE/Share/path/to/new/dirmkdir: cannot create directory `//MACHINE': No such file or directory@end exampleThis is because mkdir checks for the existence of each directory on thepath, creating them as necessary.  Since @samp{//MACHINE} is not adirectory (you can't cd to it either), mkdir tries to create it, andfails.This might get fixed someday, but for now, you have to work around it:@examplebash$ cd //MACHINE/Sharebash$ mkdir -p path/to/new/dir@end example@subsection Why doesn't my shell script work?There are two basic problems you might run into.  One is the fact that/bin/sh is really ash, and is missing some features you might expectin /bin/sh, particularly if you are used to /bin/sh actually beingbash (Linux) or ksh (Tru64).  For example:@itemize bullet@item No job control@item No getopts@item No let@item No functions exported@item Must use `.' instead of `source' (true of sh and ksh too, not just ash)@end itemizeOr, it could be a permission problem, and Cygwin doesn't understand thatyour script is executable.  Because @samp{chmod} may not work (see FAQentry above), Cygwin must read the contents of files to determine ifthey are executable.  If your script does not start with@example	#! /bin/sh@end example(or any path to a script interpreter, it does not have to be /bin/sh)then Cygwin will not know it is an executable script.  The Bourne shellidiom@example	:	# This is the 2nd line, assume processing by /bin/sh@end examplealso works.Note that you can use @samp{mount -x} to force Cygwin to treat all filesunder the mount point as executable.  This can be used for individualfiles as well as directories.  Then Cygwin will not bother to read filesto determine whether they are executable.@subsection How do I print under Cygwin?There is no working lp or lpr system as you would find on UNIX.Jason Tishler has written a couple of messages that explain how to usea2ps (for nicely formatted text in PostScript) and ghostscript (to printPostScript files on non-PostScript Windows printers).  Start at@file{http://cygwin.com/ml/cygwin/2001-04/msg00657.html}.  Note that the@samp{file} command is now available as part of Cygwin setup.Alternatively, on NT, you can use the Windows @samp{print} command.  (Itdoes not seem to be available on Win9x.)  Type@example	bash$ print /\?@end examplefor usage instructions (note the @samp{?} must be escaped from theshell).Finally, you can simply @samp{cat} the file to the printer's share name:@example	bash$ cat myfile > //host/printer@end exampleYou may need to press the formfeed button on your printer or append theformfeed character to your file.@subsection Why don't international (8-bit) characters work?Before you can type international characters (e漩) in bash, you mustadd the following lines to your @code{~/.inputrc} file:@example	set meta-flag on         set convert-meta off         set output-meta on @end exampleThese are options to the @code{readline} library, which you can readabout in the @code{bash(1)} man page.@subsection Why don't cursor keys work under Win95/Win98?@strong{(Please note: This section has not yet been updated for the latestnet release.)}Careful examination shows that they not just non-functional, butrather behave strangely, for example, with NumLock off, keys on numerickeyboard work, until you press usual cursor keys, when even numericstop working, but they start working again after hitting alphanumerickey, etc. This reported to happen on localized versions of Win98 andWin95, and not specific to Cygwin (there're known cases of Alt+Enter(fullscreen/windowed toggle) not working and shifts sticking withother programs). The cause of this problem is Microsoft keyboardlocalizer which by default installed in 'autoexec.bat'. Correspondingline looks like:@examplekeyb ru,,C:\WINDOWS\COMMAND\keybrd3.sys@end example(That's for russian locale.) You should comment that line if you wantyour keys working properly. Of course, this will deprive you of yourlocal alphabet keyboard support, so you should think aboutanother localizer. exUSSR users are of course knowledgeable of Keyruslocalizer, and it might work for other locales too, since it has keyboardlayout editor. But it has russian messages and documentation ;-(Reference URL is http://www.hnet.ru/software/contrib/Utils/KeyRus/(note the you may need to turn off Windows logo for Keyrus to operateproperly).@subsection Is it OK to have multiple copies of the DLL?You should only have one copy of the Cygwin DLL on your system.  If youhave multiple versions, they will conflict and cause problems.If you get the error "shared region is corrupted" or "shared regionversion mismatch" it means you have multiple versions of cygwin1.dllrunning at the same time.  This could happen, for example, if you updatecygwin1.dll without exiting @emph{all} Cygwin apps (including inetd)beforehand.If you're trying to find multiple versions of the DLL that are causingthis problem, reboot first, in case DLL's still loaded in memory are the

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -