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

 
 

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

Submitter:  None
Submitted:  Tue 21 Feb 2012 02:12:01 AM UTC
   
 
Category:  None Priority:  5 - Normal
Severity:  4 - Important Status:  Wont Do
Privacy:  Public Assigned to:  None
Originator Email:  -email is unavailable- Open/Closed:  Open
Operating System:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

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.
http://sourceware.org/bugzilla/show_bug.cgi?id=13712

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.



Anonymous

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-11-13 chet StatusNone Wont Do

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code