bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#15926: RFE: unlink command already uses 'unlink' call; make 'rm' use


From: Bernhard Voelker
Subject: bug#15926: RFE: unlink command already uses 'unlink' call; make 'rm' use 'remove' call
Date: Thu, 21 Nov 2013 07:32:23 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5

On 11/21/2013 01:48 AM, Linda Walsh wrote:
>     Isn't it my computer?  How do I override such a refusal?

That riddle isn't too hard, is it? ;-)

POSIX (and common sense) forbids to remove something ending on ".".
Therefore just use the canonicalized name, e.g.:

  $ mkdir /tmp/xx

  $ cd /tmp/xx

  $ rm -rv .
  rm: refusing to remove ‘.’ or ‘..’ directory: skipping ‘.’

  $ rm -rv "$(pwd -P)"
  removed directory: ‘/tmp/xx’

or alternatively (just the rm invocation):

  $ rm -rv "$(readlink -f .)"
  removed directory: ‘/tmp/xx’

As you were mentioning MS: the above obviously won't probably work
in Cygwin as the underlying (file) system may return EBUSY.

Have a nice day,
Berny





reply via email to

[Prev in Thread] Current Thread [Next in Thread]