delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/12/10/12:49:02

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-Id: <5.2.0.9.2.20021210093903.02a61eb0@pop3.cris.com>
X-Sender: rrschulz AT pop3 DOT cris DOT com
Date: Tue, 10 Dec 2002 09:50:02 -0800
To: cygwin AT cygwin DOT com
From: Randall R Schulz <rrschulz AT cris DOT com>
Subject: Re: pathing issues script failure
In-Reply-To: <34385CBC5E8E664EB0007814636AB36A677A32@exchange1.dimension
s.com>
Mime-Version: 1.0

Scott,

You're re-inventing the wheel, here.

Learn about "cygpath", for starters.

Also, a new package called "cyg-wrapper.sh" was recently released. It's an 
attempt at a generic bridging script between Cygwin command interpreters 
and Windows-native programs. I have yet to evaluate it, so I can't tell you 
more than that it exists.

I've done similar things (in more specific form) to make access to the Java 
SDK tools accessible from Cygwin scripts in such a way that the same 
scripts would be useful on a Unix / Linux / POSIX system.


Here are some hints:

- Quote your variables extensively. Spaces in file name are far more common 
under Windows and latent lack-of-quoting bugs in scripts that originate on 
Unix systems will often become manifest on Windows (including under Cygwin).

- Don't put your class files at the root of a file system volume unless 
perhaps you have a file system volume dedicated to that purpose.

- Don't assume that all your top-level packages are "com." There are 
third-party tools that reside in other top-level package: "edu," "org," 
"gnu" etc.

- Chmod has a recursive option, "-R", that obviates the use of things like 
"find ... |xargs chmod ..."

- Windows is just as happy with forward slashes even in its native format, 
so save yourself the grief of using backslashes and stick to forward 
slashes throughout. Cygpath has a "mixed-mode" option "-m" or "--mixed" 
that converts to Windows format but uses forward slashes.

Good luck.

Randall Schulz
Mountain View, CA USA


At 09:05 2002-12-10, Scott Purcell wrote:
>Hello,
>I am writing a simple shell script and I am running into some roadblocks. 
>I am sure it is something I am doing, or the way I have configured the 
>system? Anyway, the problem is in the following script, I have to type in 
>/cygdrive/c, to reach the c drive.
>
>But for some reason this script fails when it has to put the output away. 
>It switches the / unix style slashes back to windows? I am on win2000.
>I am trying to get this working, does anyone know what is wrong, or what I 
>should change to get this rolling?
>
>Thanks,
>Scott
>
>...


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019