helpThe GNU Bourne-Again SHell - Support: sr #107960, Command * or other wild card solve...


sr #107960: Command * or other wild card solve issues.

Submitted by:  None
Submitted on:  Tue 21 Feb 2012 02:12:01 AM UTC  
Category: NonePriority: 5 - Normal
Severity: 4 - ImportantStatus: Wont Do
Privacy: PublicAssigned to: None
Originator Email: -unavailable-Open/Closed: Open
Operating System: None

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

Please log in, so followups can be emailed to you.


Wed 25 Mar 2015 11:23:05 AM UTC, comment #2:

This is not a bug.

Perhaps a RFE, to add a shopt that prompts the user when filenames that look like options are expanded.

Severity should be 1 - Wish

Eduardo Bustamante <dualbus>
Wed 16 May 2012 09:01:57 PM UTC, comment #1:

I also have this problem. This is a really annoying bug. I couldn't figure out what the problem was at first. After some tries I realized that the problem was a file whose named started with '-.' .

koosha <koosha>
Tue 21 Feb 2012 02:12:01 AM UTC, original submission:

I think to fix this properly C way of handling main will have to be changed.

Issue is nasty.

rm -i * Seams fine until in the directory there is a file -rf as first file and deletes everything in the directory.

or cat * and it hits a file called -.

Over and over again user can expect one thing to happen yet the shell does something completely different.

This is not userfriendly. Means training users to use ./*

The POSIX solution is.
POSIX.1-2008 ’s “base definitions” document section 4.7 (“Filename Portability”) specifically says “Portable filenames shall not have the <hyphen> character as the first character since this may cause problems when filenames are passed as command line arguments”

Linux does not conform to this. Also other OS's don't conform so we cannot depend on this being the case.



(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by chet (Updated the item)
  • -unavailable- added by dualbus (Posted a comment)
  • -unavailable- added by koosha (Posted a comment)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 13 Nov 2015 02:22:44 AM UTCchetStatusNone=>Wont Do

    Back to the top

    Powered by Savane 3.1-cleanup