This is the mail archive of the
mailing list for the Cygwin project.
Re: cygwin and the rest of the Windows
- From: Igor Pechtchanski <pechtcha at cs dot nyu dot edu>
- To: "Ling F. Zhang" <lingfengz at yahoo dot com>
- Cc: cygwin at cygwin dot com
- Date: Sun, 22 Jun 2003 15:43:40 -0400 (EDT)
- Subject: Re: cygwin and the rest of the Windows
- Reply-to: cygwin at cygwin dot com
I'm sorry, we all make mistakes. The one I made was omitting the "-c"
flag to bash. Another was missing the quotes. So, your perl.bat should
c:\cygwin\bin\bash --login -c "/usr/bin/perl %1 %2 %3 %4 %5 %6 %7 %8 %9"
This was enough to run scripts from the command line for me (make sure you
specify the path explicitly, as the --login flag will execute
/etc/profile, which will change to your home directory). You may also
need to call cygpath.exe, since you'll be getting the Win32 pathname of
the script, I think...
For the shell files, yes, I think "c:\cygwin\bin\bash --login" should be
enough (but again, check that).
You will be able to access any directory on your C: drive using the
Also, if you use Cygwin perl, you should be using POSIX paths internally.
However, you may receive Win32 paths from Apache, in which case you'll
need to use cygpath to convert them to POSIX.
On Sun, 22 Jun 2003, Ling F. Zhang wrote:
> Let me re-cap what you just said:
> create a perl.bat with line:
> "c:\cygwin\bin\bash --login /usr/bin/perl %1 %2 %3 %4 %5 %6 %7 %8 %9"
> which will work as my perl interpreter...
> and associate my .pl files with this perl.bat
> if I want to use shell script as well, then I suppose
> I would need to associate my .sh files with
> c:\cygwin\bin\bash --login...is this correct???
> so when I do my programming, I should keep in mind
> that I only have the cygwin filesystem to access
> so if I want to point to a file /home/admin/foo, I
> would use /home/admin/foo, and not
> c:\cygwin\home\admin\foo. Is this correct???
> > Ling,
> > Well, technically, you'll have to do a bit more than that. First off, the
> > #! line will not be recognized by Windows. Thus, you'll need to
> > associate the .pl extension *in Windows Explorer* with whatever perl
> > interpreter you have (I'd guess "C:\cygwin\bin\perl.exe"). Secondly,
> > you might be missing the login environment, so you might wish to create a
> > perl.bat file that does a "c:\cygwin\bin\bash --login /usr/bin/perl %1 %2
> > %3 %4 %5 %6 %7 %8 %9" and use that instead (beware of directory changes).
> > Alternatively, if you want to use the #! line, you could associate .pl
> > files with "c:\cygwin\bin\bash -c"... In the end, it might be less
> > trouble to just run Cygwin apache.
> > Igor
> >  You missed the "!" in your examples... ;-)
> >  /usr/bin is a mount, and thus is not visible to non-Cygwin programs.
> > C:\cygwin\usr\bin should be empty.
> > On Sat, 21 Jun 2003, Ling F. Zhang wrote:
> > > okay! the question is this then: say I write a perl script...
> > > should the first line be
> > > #/usr/bin/perl
> > > or
> > > #C:\cygwin\usr\bin\perl ?
> > >
> > > thank you
> > >
> > > --- Igor Pechtchanski <firstname.lastname@example.org> wrote:
> > > > On Sat, 21 Jun 2003, Ling F. Zhang wrote:
> > > >
> > > > > I successfully ran both the cygwin apache (1.3x) and
> > > > > windows native one (2.x). So I need to chose one to
> > > > > run (as they wouldn't share port 80)...sine I usually
> > > > > do my cgi in perl and shell-script, cygwin is the
> > > > > clear choice...but I do miss such feature as WebDAV in
> > > > > the version 2 (I didn't feel like recompiling apache
> > > > > on cygwin just to mess things up). So, here's the
> > > > > question, is it possible for windows to use cygwin
> > > > > developement tools? as in, can I use the cygwin perl
> > > > > interpretor to interpret my perl script if the apache
> > > > > is the windows native one?
> > > >
> > > > Ling,
> > > >
> > > > Yes, it's theoretically possible, as long as the Cygwin /bin directory
> > > > is in the path. There may be some peculiarities specific to your
> > > > system that you'd have to solve (in particular, all the scripts will
> > > > get Win32 paths as parameters, rather than Cygwin POSIX paths), but
> > > > there's nothing major that prevents you from doing this.
> > > > Igor
|\ _,,,---,,_ email@example.com
ZZZzz /,`.-'`' -. ;-;;,_ firstname.lastname@example.org
|,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D.
'---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow!
"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster." -- Patrick Naughton
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html