Subject: bug#21636: closed (Re: bug#21636: a question of the“wc” program)

From: [email-masked] (GNU bug Tracking System)
Date: Tue, 06 Oct 2015 16:02:04 +0000

Your bug report

#21636: a question of the “wc” program

which was filed against the coreutils package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
21636: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=21636
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#21636: a question of the “wc” program
From: Eric Blake <[email-masked]>
To: JameDam <[email-masked]>, [email-masked]
Date: Tue, 6 Oct 2015 10:01:15 -0600
List-Id: <debbugs-submit.debbugs.gnu.org>

tag 21636 notabug
thanks

On 10/06/2015 04:49 AM, JameDam wrote:
> I have a file which is named *“-l”*, and I use the wc to count the file, 
> undesirably wc requested the standard input rather than my file *"-l"* ,although 
> I use it through the command
> */wc -lw -l/*

Try either of:

wc -lw -- -l
wc -lw ./-l

This is not a bug in wc.  Rather, it is a FAQ:
https://www.gnu.org/software/coreutils/faq/coreutils-faq.html#I-have-a-file-called-_002d_002dhelp_002e-How-do-I-remove-it_003f

And like most utilities, using an explicit -- to mark the end of
options, or spelling your file name with a leading ./ so that it can't
be confused with an option, will do the trick.

Therefore, I'm closing this as not a bug, although you should feel free
to add any further comments or questions to this thread.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Subject: a question of the “wc” program
From: JameDam <[email-masked]>
To: [email-masked]
Date: Tue, 06 Oct 2015 18:49:30 +0800
List-Id: <debbugs-submit.debbugs.gnu.org>

I have a file which is named “-l”, and I use the wc to count the file, undesirably wc requested the standard input rather than my file "-l" ,although I use it through the command

wc -lw -l

it didn't work as my will, however, linux itself do not limit this kind of name style, but wc does, so unreasonable, such as my above command actually doesn't cause a ambiguity, so can you improve it ? try to check whether those files exist by the args from arg[2] atleast,not ignore those arguments.

expect your reply.:)

Cheers,

JameDam