Bug 239281 - rm something is different that rm something/
rm something is different that rm something/
Product: Fedora
Classification: Fedora
Component: bash-completion (Show other bugs)
All Linux
medium Severity low
: ---
: ---
Assigned To: Ville Skyttä
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2007-05-07 08:19 EDT by Adam Tkac
Modified: 2013-04-30 19:35 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-05-06 21:41:51 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Adam Tkac 2007-05-07 08:19:00 EDT
Description of problem:
rm something is different that rm something/ . This causes interesting problems
when I want remove symlink to directory and I write start of directory and press
tab and enter, rm says that something is directory and it can't remove it

Version-Release number of selected component (if applicable):
rpm -q coreutils

How reproducible:

Steps to Reproduce:
1. mkdir bogus && ln -s bogus bogusasdf
2. rm bogusa<tab> (bash fill it like 'rm bogusasdf/') + enter
3. rm: cannot remove `bogusasdf/': is directory
Actual results:
error message

Expected results:
symlink is succesffuly removed

Additional info:
when I type 'rm bogusasdf' without '/' all works fine
Comment 1 Jim Meyering 2007-05-07 08:49:58 EDT
Thanks for the report, but this is not a problem with rm.  rm is required to
honor such trailing slashes.  POSIX requires it to treat "rm symlink-to-dir/"
just like "rm symlink-to-dir/."

That said, there may be a way to make bash do completion the way you'd like. 
However, I switched from bash to zsh a few years ago in part because it handles
that sort of completion in a more intuitive fashion.

For example, using zsh,

  $ mkdir dir && ln -s dir long-symlink-name
  $ rm long-s<tab>
    rm long-symlink-name/

But on the line above, the last thing I typed was TAB.  If I now type SPACE or
ENTER, zsh removes the trailing "/" it added before invoking the command. 
However, if I type "/", the displayed line remains unchanged, but zsh will not
remove the trailing slash.
Comment 2 Adam Tkac 2007-05-07 09:00:46 EDT
(In reply to comment #1)
I'm not posix master so I didn't know that posix requires this. So let check
feedback on bash side...

Comment 3 Tim Waugh 2007-05-08 06:02:47 EDT
The 'complete' builtin can do this if you like; perhaps it's something for the
bash-completions package to consider.
Comment 4 Bug Zapper 2008-04-03 20:34:26 EDT
Based on the date this bug was created, it appears to have been reported
against rawhide during the development of a Fedora release that is no
longer maintained. In order to refocus our efforts as a project we are
flagging all of the open bugs for releases which are no longer
maintained. If this bug remains in NEEDINFO thirty (30) days from now,
we will automatically close it.

If you can reproduce this bug in a maintained Fedora version (7, 8, or
rawhide), please change this bug to the respective version and change
the status to ASSIGNED. (If you're unable to change the bug's version
or status, add a comment to the bug and someone will change it for you.)

Thanks for your help, and we apologize again that we haven't handled
these issues to this point.

The process we're following is outlined here:

We will be following the process here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping to ensure this
doesn't happen again.
Comment 5 Bug Zapper 2008-05-06 21:41:49 EDT
This bug has been in NEEDINFO for more than 30 days since feedback was
first requested. As a result we are closing it.

If you can reproduce this bug in the future against a maintained Fedora
version please feel free to reopen it against that version.

The process we're following is outlined here:

Note You need to log in before you can comment on or make changes to this bug.