From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 16 22:53:05 2011 Received: (at submit) by debbugs.gnu.org; 17 Apr 2011 02:53:05 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QBI6i-00005N-Ff for submit@debbugs.gnu.org; Sat, 16 Apr 2011 22:53:04 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QBI1w-0008QF-HK for submit@debbugs.gnu.org; Sat, 16 Apr 2011 22:48:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QBI1q-0004ql-I8 for submit@debbugs.gnu.org; Sat, 16 Apr 2011 22:48:03 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RFC_ABUSE_POST,T_DKIM_INVALID, T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:35310) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QBI1q-0004qh-Gb for submit@debbugs.gnu.org; Sat, 16 Apr 2011 22:48:02 -0400 Received: from eggs.gnu.org ([140.186.70.92]:47063) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QBI1p-0001CV-GV for bug-coreutils@gnu.org; Sat, 16 Apr 2011 22:48:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QBI1o-0004qS-Oa for bug-coreutils@gnu.org; Sat, 16 Apr 2011 22:48:01 -0400 Received: from mail-vx0-f169.google.com ([209.85.220.169]:49085) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QBI1o-0004qO-MR for bug-coreutils@gnu.org; Sat, 16 Apr 2011 22:48:00 -0400 Received: by vxk20 with SMTP id 20so3860300vxk.0 for ; Sat, 16 Apr 2011 19:47:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=0BNSb/nPvutW3MpQ7pGskk4p8BFJFQIE5DswD254rBk=; b=r9rIe4dUWRyn9RkBBf+m9qHnYLEtNR1RKLInwznRw0j1WQU4hmmOXRizzje5YW1yI3 bAyk9DRoJeyXadteaSc/y4OO2xGXR9O6Im+9fEnvpu8PmIRfaEEY3jNs95m7EBhiUn2R smbfCNaIgx8S00ilKAPopCuXPz/ni4okTTW4Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=X8cnifXrucJklVMOcpHA20LwcLd2pIkvDwMAB9hy6xUFTviR/Tp61kz6H9NaMS4hfd 1HuweXY2IUgStBdwPILHKNeBRHVIDTBoKxMjgE4nPFXf/gpbxvRW94DqQpa1lnawCxCP OOY+AEl4ONhx2tUAMk6ZupOfHX8zJp9ZBPbQ8= MIME-Version: 1.0 Received: by 10.52.175.103 with SMTP id bz7mr4587544vdc.178.1303008479668; Sat, 16 Apr 2011 19:47:59 -0700 (PDT) Received: by 10.220.62.143 with HTTP; Sat, 16 Apr 2011 19:47:59 -0700 (PDT) Date: Sun, 17 Apr 2011 04:47:59 +0200 Message-ID: Subject: stat list file name From: - - To: bug-coreutils@gnu.org Content-Type: multipart/alternative; boundary=bcaec5171ddb91e7f304a1144deb X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -5.9 (-----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sat, 16 Apr 2011 22:53:03 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.9 (-----) --bcaec5171ddb91e7f304a1144deb Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable here a small bug in stat: stat -c %n * stat : option invalide -- 's' Saisissez =AB stat --help =BB pour plus d'informations. ls -sdjf=E8`@$&.txt stat is not able to list a direstory if a file start with a - --bcaec5171ddb91e7f304a1144deb Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable here a small bug in stat:

stat -c %n *
st= at : option invalide -- 's'
Saisissez =AB stat --help =BB= pour plus d'informations.

ls
-sdjf= =E8`@$&.txt

stat is not able to list a direstory if a file st= art with a -
--bcaec5171ddb91e7f304a1144deb-- From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 17 01:51:18 2011 Received: (at 8513-done) by debbugs.gnu.org; 17 Apr 2011 05:51:19 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QBKtC-0003sh-Ln for submit@debbugs.gnu.org; Sun, 17 Apr 2011 01:51:18 -0400 Received: from joseki.proulx.com ([216.17.153.58]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QBKtA-0003sS-Lq for 8513-done@debbugs.gnu.org; Sun, 17 Apr 2011 01:51:17 -0400 Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119]) by joseki.proulx.com (Postfix) with ESMTP id D446721311; Sat, 16 Apr 2011 23:51:10 -0600 (MDT) Received: by hysteria.proulx.com (Postfix, from userid 1000) id BFB712DC52; Sat, 16 Apr 2011 23:51:10 -0600 (MDT) Date: Sat, 16 Apr 2011 23:51:10 -0600 From: Bob Proulx To: - - Subject: Re: bug#8513: stat list file name Message-ID: <20110417055110.GA11268@hysteria.proulx.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.4 (--) X-Debbugs-Envelope-To: 8513-done Cc: 8513-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.4 (--) - - wrote: > here a small bug in stat: >=20 > stat -c %n * > stat : option invalide -- 's' > Saisissez =AB stat --help =BB pour plus d'informations. >=20 > ls > -sdjf=E8`@$&.txt >=20 > stat is not able to list a direstory if a file start with a - Thank you for your bug report but this is not a bug in stat but a misunderstanding of how file globs operate with your command shell. The '*' on your command line is expanded by the shell to all of the files in the directory. You have a filename that starts with a dash. The resulting command line is the same as if you had placed the dash on the command line yourself. You can see this by using 'echo' to print out the command. $ echo stat -c %n * echo stat -c %n -sdjf=E8`@$&.txt As you can see by using echo there is no difference between having a file starting with a dash and placing an option with a dash on the command line. The only way to tell is for you to invoke the command without the ambiguity. Either use ./* to avoid having filenames start with a dash or use "--" to signal to the command that there are no further options. Either: $ stat -c %n ./* Or: $ stat -c %n -- * Bob From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 17 02:06:45 2011 Received: (at 8513) by debbugs.gnu.org; 17 Apr 2011 06:06:45 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QBL89-0004Cv-2o for submit@debbugs.gnu.org; Sun, 17 Apr 2011 02:06:45 -0400 Received: from mail2.nikola.com ([64.146.180.253] helo=nikola.com) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QBL7s-0004CX-Am for 8513@debbugs.gnu.org; Sun, 17 Apr 2011 02:06:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=nikola.com; s=MDaemon; t=1303020380; x=1303625180; q=dns/txt; h=Received: Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=U20DU/mcDGtj5NxNVG1LyFwIMgVt6zUjx4/gbJjg2ms=; b=EMzw1zRQdx+dO drSd19FBPYXFJ79j0HWNT+CgNguKJ504aPxxr81SSzdWbpKPxT/SagMNzvs+oDkP YPnw3phuU8/TxUET0R6+SSiJdn5Ys+tZNuORIlV6iyM1hKZkOkihBHDN3oiYQ8fq yw0CXAqYcFJ0rc35LkS8ji7TGHGxEA= X-MDAV-Processed: nikola.com, Sat, 16 Apr 2011 23:06:20 -0700 Received: from videoflier.com by nikola.com (Cipher TLSv1:RC4-MD5:128) (MDaemon PRO v11.0.3) with ESMTP id md50006704056.msg for <8513@debbugs.gnu.org>; Sat, 16 Apr 2011 23:06:20 -0700 X-Spam-Processed: nikola.com, Sat, 16 Apr 2011 23:06:20 -0700 (not processed: message from trusted or authenticated source) X-Authenticated-Sender: jesseg@nikola.com X-MDRemoteIP: 64.146.180.232 X-Return-Path: jesseg@nikola.com X-Envelope-From: jesseg@nikola.com X-MDaemon-Deliver-To: 8513@debbugs.gnu.org Message-ID: <4DAA824D.3000401@nikola.com> Date: Sat, 16 Apr 2011 23:01:49 -0700 From: Jesse Gordon User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.16) Gecko/20101125 Thunderbird/3.0.11 MIME-Version: 1.0 To: - - Subject: Re: bug#8513: stat list file name References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -3.0 (---) X-Debbugs-Envelope-To: 8513 Cc: 8513@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.0 (---) On 04/16/2011 07:47 PM, - - wrote: > here a small bug in stat: > > stat -c %n * > stat : option invalide -- 's' > Saisissez « stat --help » pour plus d'informations. > > ls > -sdjfè`@$&.txt > > stat is not able to list a direstory if a file start with a - > > > That's not a bug with stat. It's due to the fact that the general unix style of command parameters starts with a dash. The problem is that for 40 years, the writers of utilities assumed nobody would ever name a file starting with a dash -- which is why they used a dash to indicate a command line parameter. Almost all utilities which use command line parameters or options which start with a dash will have the same problem with any file that starts with a dash, because when they see a "-" they think it's a parameter or option instead of a file. The solution is to provide a fuller path to the file. Instead of doing stat * do stat ./* or if the file is named -something, do stat ./-something. The leading "./" (which stands for "Current directory) comes in front of the dash and so stat doesn't think it's a parameter or option. Jesse Gordon From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 17 02:29:08 2011 Received: (at 8513) by debbugs.gnu.org; 17 Apr 2011 06:29:08 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QBLTo-0004gp-1F for submit@debbugs.gnu.org; Sun, 17 Apr 2011 02:29:08 -0400 Received: from mx.meyering.net ([82.230.74.64]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QBLTm-0004gO-92 for 8513@debbugs.gnu.org; Sun, 17 Apr 2011 02:29:06 -0400 Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000) id B79FD6012A; Sun, 17 Apr 2011 08:29:00 +0200 (CEST) From: Jim Meyering To: 8513@debbugs.gnu.org Subject: Re: bug#8513: stat list file name In-Reply-To: <20110417055110.GA11268@hysteria.proulx.com> (Bob Proulx's message of "Sat, 16 Apr 2011 23:51:10 -0600") References: <20110417055110.GA11268@hysteria.proulx.com> Date: Sun, 17 Apr 2011 08:29:00 +0200 Message-ID: <8762qdgzmb.fsf@rho.meyering.net> Lines: 9 MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -5.9 (-----) X-Debbugs-Envelope-To: 8513 Cc: bob@proulx.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.9 (-----) tags 8513 notabug close 8513 thanks Bob Proulx wrote: > Thank you for your bug report but this is not a bug in stat but a > misunderstanding of how file globs operate with your command shell. And thank you for replying, Bob. From unknown Mon Aug 18 09:04:06 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 15 May 2011 11:24:04 +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