delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/02/16/10:36:06

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
X-Authentication-Warning: hp2.xraylith.wisc.edu: khan owned process doing -bs
Date: Fri, 16 Feb 2001 09:34:32 -0600 (CST)
From: Mumit Khan <khan AT NanoTech DOT Wisc DOT EDU>
To: klaus DOT berndl AT sdm DOT de
cc: cygwin AT sourceware DOT cygnus DOT com
Subject: Re: Problem with basename
In-Reply-To: <C9A98ED35114D31197D000805FEA668E027B19BB@mucexch.muc.sdm.de>
Message-ID: <Pine.HPP.3.96.1010216093208.29747C-100000@hp2.xraylith.wisc.edu>
MIME-Version: 1.0
X-MIME-Autoconverted: from QUOTED-PRINTABLE to 8bit by delorie.com id KAA09795

On Fri, 16 Feb 2001 klaus DOT berndl AT sdm DOT de wrote:

> But if i write the functon like follows:
> 
>     function check-el-compile ()
>     {
> 	for file in `ls *.el`; do
>             # same as above.
> 
> then the basename call doesn´t work, i.e. it always returns $file.
> It seems that the output of ls contains "something" which confuses basename?!

ls outputs all sorts of control characters, but those *should* be
suppressed in this case (haven't checked however, so may be wrong). 
Try:

 	for file in *.el; do
          # use $file
	done

instead. There is no reason to invoke another program to do what the shell
itself is fully capable of.

Regards,
Mumit



--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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