delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/06/04/13:21:33

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/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
Date: Fri, 4 Jun 2004 13:13:51 -0400
From: Ashok Vadekar <avadekar AT certicom DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Recent change in redirection handling?
Message-ID: <20040604171351.GA698@certicom.com>
Reply-To: avadekar AT certicom DOT com
References: <20040604154513 DOT GA153 AT certicom DOT com> <Pine DOT GSO DOT 4 DOT 58 DOT 0406041223160 DOT 2262 AT slinky DOT cs DOT nyu DOT edu>
Mime-Version: 1.0
In-Reply-To: <Pine.GSO.4.58.0406041223160.2262@slinky.cs.nyu.edu>
User-Agent: Mutt/1.4i
X-IsSubscribed: yes

On Fri, Jun 04, 2004 at 12:32:46PM -0400, Igor Pechtchanski wrote:
> On Fri, 4 Jun 2004, Ashok Vadekar wrote:
> 
> > I have a bash script that ran cleanly under 1.5.9x, that now exhibits some
> > disturbing behaviour under a recent upgrade.  The gist of the problem is that
> > the execution of
> >         compact /c file.exe >NUL
> > which used to run and produce no output (due to the redirect) now actually
> > puts the output into a file called NUL
> > So, I can deal with the fact that the script needs to either use
> > NUL: (which I did not test) or maybe more appropriately /dev/null (which
> > works), but I now have the NUL files polluting my disk that cannot be removed!
> >
> > Under a real unix shell, I've had occasion to drop down to a bourne shell to
> > delete filenames with wilrdcard characters that a (t)csh would have trouble
> > with, but I have not found a similar was to deal with this.  Using
> >         rm NUL
> > in bash does not work;
> >         rem NUL
> > in a dos box doesn't work, and the windows explorer doesn't either.
> >
> > Any suggestions?
> 
> Known problem.  See <http://cygwin.com/ml/cygwin/2004-05/msg00905.html>
> and <http://cygwin.com/ml/cygwin/2004-06/msg00144.html>.  In particular,
> the thread referenced in the first message should tell you how to remove
> the file.

Thanks for the pointer.

> 
> Incidentally, why do you redirect to NUL rather than to /dev/null?

I usually end up having trouble when I try to use native windows excutables
in bash scripts.  Redmond and I don't seem to see eye-to-eye on parameter passing
etal.  So I end up testing the use of the executables in a DOS box first.  As a
result, I used NUL.  When I put the functionality into the bash script, I just
neglected to use the (unix) cannonical method.  In this particular case, in addition 
to the compact call, I was trying to set up environment variables through the
use of REG, and was having trouble with the quotes and slashes getting handled 
differently by bash and CMD.  Worse yet, the registry manipulation was going
into a sprintf/system() call so that a binary was calling REG, so it was somewhat 
obscured.

> 	Igor
> -- 
> 				http://cs.nyu.edu/~pechtcha/
>       |\      _,,,---,,_		pechtcha AT cs DOT nyu DOT edu
> ZZZzz /,`.-'`'    -.  ;-;;,_		igor AT watson DOT ibm DOT com
>      |,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
> Documentation:         http://cygwin.com/docs.html
> FAQ:                   http://cygwin.com/faq/

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.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