This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Problem with basename


On Fri, 16 Feb 2001 klaus.berndl@sdm.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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]