delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/05/08/08:24:51

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
From: "Dave Korn" <dave DOT korn AT artimi DOT com>
To: <cygwin AT cygwin DOT com>
References: <5501af8c DOT 2ea311e4 DOT 4822ebcb DOT eab08 AT o2 DOT pl> <4822EEBB DOT 2070305 AT byu DOT net>
Subject: RE: rm: cannot remove `fil*.txt': No such file or directory
Date: Thu, 8 May 2008 13:24:11 +0100
Message-ID: <05ab01c8b106$6bed67e0$2708a8c0@CAM.ARTIMI.COM>
MIME-Version: 1.0
X-Mailer: Microsoft Office Outlook 11
In-Reply-To: <4822EEBB.2070305@byu.net>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
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

Eric Blake wrote on 08 May 2008 13:15:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> According to mirz on 5/8/2008 6:02 AM:
>> sh-3.2$ rm fil*.txt
>> rm: cannot remove `fil*.txt': No such file or directory
>> 
>> When I used * with ls it works correct
>> sh-3.2$ ls fil*
>> file.txt
> 
> Why not 'rm fil*' - if ls can use it, then rm can too, because * is
> expanded by the shell, and not by ls or rm.
> 
> In the meantime, you might want to try 'ls -Q fil*' - perhaps the reason
> that 'fil*.txt' fails but 'fil*' works is that the suffix is not truly
> '.txt' but something cruel like '.txt '.

  Yes, the error message from rm clearly shows that the glob has failed to
match anything in the current directory, and is trying to delete a filename
that has an actual asterisk in the middle of it.

  What's a bit curious is why that glob failed, when the earlier 'touch'
command should have created that exact file, and not anything like '.txt '.

  mirz, The thing to try is using autocompletion to see what bash thinks is
matching and at what point it goes wrong.

  Type "rm fil*", then press TAB once or twice and ensure that 'file.txt'
shows up.  Then try it again with "rm fil*.*", "rm fil*.t*", and rm
"fil*.tx*", finally "rm fil*.txt*" and then "rm fil*.txt".  See what happens
at each stage and which one is the first to fail to match.

  Oh, also, send us your cygcheck attachment.  There's something probably not
quite right in your configuration if you get the "sh" prompt.

  Say, you don't have MinGW or MSYS installed as well as Cygwin and are maybe
getting interference between the two, are you?


    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....


--
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