Bug 239281

Summary: rm something is different that rm something/
Product: [Fedora] Fedora Reporter: Adam Tkac <atkac>
Component: bash-completionAssignee: Ville Skyttä <ville.skytta>
Status: CLOSED INSUFFICIENT_DATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: medium    
Version: rawhideCC: dkovalsk, jnavrati, meyering, ovasik, sheltren, triage
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard: bzcl34nup
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-05-07 01:41:51 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Adam Tkac 2007-05-07 12:19:00 UTC
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
coreutils-6.9-2.fc7

How reproducible:
always

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 12:49:58 UTC
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 13:00:46 UTC
(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...

-A-

Comment 3 Tim Waugh 2007-05-08 10:02:47 UTC
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-04 00:34:26 UTC
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:
http://fedoraproject.org/wiki/BugZappers/F9CleanUp

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-07 01:41:49 UTC
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:
http://fedoraproject.org/wiki/BugZappers/F9CleanUp