From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 06 11:11:52 2015 Received: (at submit) by debbugs.gnu.org; 6 Oct 2015 15:11:52 +0000 Received: from localhost ([127.0.0.1]:57243 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZjTuC-0007D9-Bf for submit@debbugs.gnu.org; Tue, 06 Oct 2015 11:11:52 -0400 Received: from eggs.gnu.org ([208.118.235.92]:57746) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZjPoV-0007sK-W5 for submit@debbugs.gnu.org; Tue, 06 Oct 2015 06:49:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZjPoU-0004dE-SS for submit@debbugs.gnu.org; Tue, 06 Oct 2015 06:49:43 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.9 required=5.0 tests=BAYES_50,HTML_MESSAGE, HTML_MIME_NO_HTML_TAG,MIME_HTML_ONLY autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:47405) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZjPoU-0004d4-Pg for submit@debbugs.gnu.org; Tue, 06 Oct 2015 06:49:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39518) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZjPoT-0000lF-VP for bug-coreutils@gnu.org; Tue, 06 Oct 2015 06:49:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZjPoO-0004WH-5t for bug-coreutils@gnu.org; Tue, 06 Oct 2015 06:49:41 -0400 Received: from forward13p.cmail.yandex.net ([87.250.241.140]:41886) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZjPoN-0004Ur-Uj for bug-coreutils@gnu.org; Tue, 06 Oct 2015 06:49:36 -0400 Received: from web10g.yandex.ru (web10g.yandex.ru [95.108.252.110]) by forward13p.cmail.yandex.net (Yandex) with ESMTP id B17E9212BD for ; Tue, 6 Oct 2015 13:49:31 +0300 (MSK) Received: from 127.0.0.1 (localhost [127.0.0.1]) by web10g.yandex.ru (Yandex) with ESMTP id 529D13425E9; Tue, 6 Oct 2015 13:49:31 +0300 (MSK) Received: by web10g.yandex.ru with HTTP; Tue, 06 Oct 2015 13:49:30 +0300 From: JameDam To: bug-coreutils@gnu.org Subject: =?utf-8?B?YSBxdWVzdGlvbiBvZiB0aGUg4oCcd2PigJ0gcHJvZ3JhbQ==?= MIME-Version: 1.0 Message-Id: <9201444128570@web10g.yandex.ru> X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Tue, 06 Oct 2015 18:49:30 +0800 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -3.3 (---) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Tue, 06 Oct 2015 11:11:50 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---)
=C2=A0
I have a file which is named =E2=80=9C-l=E2= =80=9D, and I use the wc to count the file, undesirably wc reque= sted the standard input rather than my file "-l" ,althou= gh I use it through the command
wc -lw -l
it didn't work as my will, howev= er, linux itself do not limit this kind of name style, but wc does, so un= reasonable, 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 arg= s from arg[2] atleast,not ignore those arguments.
=C2=A0
expect your reply.:)
=C2=A0
=C2=A0
=C2=A0
Cheers,
JameDam
<= div>=C2=A0
From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 06 12:01:25 2015 Received: (at control) by debbugs.gnu.org; 6 Oct 2015 16:01:25 +0000 Received: from localhost ([127.0.0.1]:57275 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZjUg9-0008OW-H7 for submit@debbugs.gnu.org; Tue, 06 Oct 2015 12:01:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55272) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZjUg5-0008OG-Sx; Tue, 06 Oct 2015 12:01:22 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 1A5BD319AE0; Tue, 6 Oct 2015 16:01:21 +0000 (UTC) Received: from [10.3.113.202] (ovpn-113-202.phx2.redhat.com [10.3.113.202]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t96G1Kf9003043; Tue, 6 Oct 2015 12:01:20 -0400 Subject: =?UTF-8?Q?Re:_bug#21636:_a_question_of_the_=e2=80=9cwc=e2=80=9d_pro?= =?UTF-8?Q?gram?= To: JameDam , 21636-done@debbugs.gnu.org References: <9201444128570@web10g.yandex.ru> From: Eric Blake Openpgp: url=http://people.redhat.com/eblake/eblake.gpg Organization: Red Hat, Inc. Message-ID: <5613F04B.4020000@redhat.com> Date: Tue, 6 Oct 2015 10:01:15 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <9201444128570@web10g.yandex.ru> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="C2sFM5H1OC3ixlBOXMsh34Cv5evMlhVfx" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --C2sFM5H1OC3ixlBOXMsh34Cv5evMlhVfx Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable tag 21636 notabug thanks On 10/06/2015 04:49 AM, JameDam wrote: > I have a file which is named *=E2=80=9C-l=E2=80=9D*, and I use the wc t= o count the file,=20 > undesirably wc requested the standard input rather than my file *"-l"* = ,although=20 > 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-fi= le-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. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --C2sFM5H1OC3ixlBOXMsh34Cv5evMlhVfx Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWE/BPAAoJEKeha0olJ0NqF6EH+wfF6lwavDMBy6gPsbiptRab 47t254SekvsXZqQNKZbMqeq0VoXB8rcRawIR+1YRkDRfjoxq61pRpbB+fdevsAc4 94FPFUQRceHcSthLlqCg0Wf85Iaerfjno17THwcum68E08Zg2yQD0/lQNVMYT2n7 vCBBdfbOUL59ahah6eQfk1ygbX+lT6FZ2coaKWqUb1wqSM9/4j3SEUhywPnm3q1f 2H5APDI6NqgaiZ9nCg3M1kM0bZNDC/jR0OrTGiiRUtzQk8xtT7Na/veA3p03EqEs 2xkShvhZUnnya4YAUBkBQJrn2/ZYS4A3kEpgvPGwxKKy51FQJozy7ZpxbWjeQTY= =y2qE -----END PGP SIGNATURE----- --C2sFM5H1OC3ixlBOXMsh34Cv5evMlhVfx-- From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 06 15:38:52 2015 Received: (at 21636) by debbugs.gnu.org; 6 Oct 2015 19:38:52 +0000 Received: from localhost ([127.0.0.1]:57378 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZjY4a-00032Y-6e for submit@debbugs.gnu.org; Tue, 06 Oct 2015 15:38:52 -0400 Received: from mail-wi0-f181.google.com ([209.85.212.181]:32966) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZjY4E-000325-RU for 21636@debbugs.gnu.org; Tue, 06 Oct 2015 15:38:49 -0400 Received: by wiclk2 with SMTP id lk2so182901472wic.0 for <21636@debbugs.gnu.org>; Tue, 06 Oct 2015 12:38:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:references:mime-version :content-type:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=03lxNNtdknjVx3B7YUP3QbZjbn5gAv/mBQh6iakkGqw=; b=n13Sm363CTGU1uBah63nFBezrGCnFhObEdMh/KmC9WG5fHPtDI3I9J/mJk2QjCWkg1 MLbKRpK1yO0Uf1v7MrspraDHidP2+LVH1KKgluwBLM34m5b5UUgoE5ncVIKju9HzWGwY 15J4qjnG0xrod2jP5bmyZyLE4n9mabJoG66QPP7jqv6w01l7wMm3jvv9kzcDgwiyqdpA Rlwz0HhBhkka5osGDzL2qKE6cKZQPPjCIP+miTH7ew/KVeXpr8twgH0mGeF6+QNRoQqg Jb65OkxzADOJxwmXZnFyzCyQC34JA+WtPzX7xTS/VGwDTzLPknfdKXBx8yc1eUyfyoqf w/UQ== X-Received: by 10.194.117.39 with SMTP id kb7mr36916733wjb.129.1444160310087; Tue, 06 Oct 2015 12:38:30 -0700 (PDT) Received: from chaz.gmail.com ([2.121.17.252]) by smtp.gmail.com with ESMTPSA id jd7sm12569355wjb.19.2015.10.06.12.38.28 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 06 Oct 2015 12:38:29 -0700 (PDT) Date: Tue, 6 Oct 2015 20:38:27 +0100 From: Stephane Chazelas To: 21636@debbugs.gnu.org, eblake@redhat.com, te@dam.moe Subject: Re: bug#21636: a question of =?utf-8?Q?the?= =?utf-8?B?IOKAnHdj4oCd?= program Message-ID: <20151006193827.GB11237@chaz.gmail.com> References: <9201444128570@web10g.yandex.ru> <5613F04B.4020000@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5613F04B.4020000@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 21636 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) 2015-10-06 10:01:15 -0600, Eric Blake: > 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. [...] Or: wc -lw < -l which in this case also has the benefit of not outputting the file name. Note that: wc -lw -- "$file" Doesn't work for a file called "-". wc -lw < - wc -lw ./- are OK. -- Stephane From unknown Sat Jun 21 10:46:09 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 04 Nov 2015 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator