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: None
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 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 File(s):
   
   
Comment:
   

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 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):

     

     

    No Changes Have Been Made to This Item

    Back to the top


    Powered by Savane 3.1-cleanup