From unknown Fri Jun 20 07:09:15 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#25388 <25388@debbugs.gnu.org> To: bug#25388 <25388@debbugs.gnu.org> Subject: Status: ls-quotes: kills existing scripts reading "ls" -1 as input Reply-To: bug#25388 <25388@debbugs.gnu.org> Date: Fri, 20 Jun 2025 14:09:15 +0000 retitle 25388 ls-quotes: kills existing scripts reading "ls" -1 as input reassign 25388 coreutils submitter 25388 L A Walsh severity 25388 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 07 22:52:25 2017 Received: (at submit) by debbugs.gnu.org; 8 Jan 2017 03:52:25 +0000 Received: from localhost ([127.0.0.1]:46372 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQ4Wv-00005i-CF for submit@debbugs.gnu.org; Sat, 07 Jan 2017 22:52:25 -0500 Received: from eggs.gnu.org ([208.118.235.92]:41162) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQ4Wt-00005V-Jn for submit@debbugs.gnu.org; Sat, 07 Jan 2017 22:52:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cQ4Wn-00046b-Gk for submit@debbugs.gnu.org; Sat, 07 Jan 2017 22:52:18 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.0 required=5.0 tests=BAYES_40,DATE_IN_PAST_12_24 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:36376) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cQ4Wn-00046X-Dg for submit@debbugs.gnu.org; Sat, 07 Jan 2017 22:52:17 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60366) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cQ4Wm-000431-7r for bug-coreutils@gnu.org; Sat, 07 Jan 2017 22:52:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cQ4Wj-00046C-75 for bug-coreutils@gnu.org; Sat, 07 Jan 2017 22:52:16 -0500 Received: from ishtar.tlinx.org ([173.164.175.65]:48486 helo=Ishtar.sc.tlinx.org) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cQ4Wi-00045M-RA for bug-coreutils@gnu.org; Sat, 07 Jan 2017 22:52:13 -0500 Received: from [192.168.3.12] (Athenae [192.168.3.12]) by Ishtar.sc.tlinx.org (8.14.7/8.14.4/SuSE Linux 0.8) with ESMTP id v083plnj051701 for ; Sat, 7 Jan 2017 19:51:49 -0800 Message-ID: <587065F6.4040504@tlinx.org> Date: Fri, 06 Jan 2017 19:52:22 -0800 From: L A Walsh User-Agent: Thunderbird MIME-Version: 1.0 To: bug-coreutils@gnu.org Subject: Bug in ls, kills existing scripts reading "ls" -1 as input Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -4.2 (----) The new ls doesn't maintain backwards compatibility. The default options now add extraneous quotes to some filenames. Anyplace one uses 'ls -1' to read 1 file/line now breaks. This is a regression as it breaks existing scripts and behavior. From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 08 04:02:12 2017 Received: (at 25388) by debbugs.gnu.org; 8 Jan 2017 09:02:12 +0000 Received: from localhost ([127.0.0.1]:46471 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQ9Mi-0008Gb-Jb for submit@debbugs.gnu.org; Sun, 08 Jan 2017 04:02:12 -0500 Received: from mail-out.m-online.net ([212.18.0.10]:43885) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQ9Mg-0008GR-Qh for 25388@debbugs.gnu.org; Sun, 08 Jan 2017 04:02:11 -0500 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 3txC346brXz3hrQC; Sun, 8 Jan 2017 10:02:08 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.68]) by mail.m-online.net (Postfix) with ESMTP id 3txC345NPhzvkZs; Sun, 8 Jan 2017 10:02:08 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.68]) (amavisd-new, port 10024) with ESMTP id VhLxriBqG_yh; Sun, 8 Jan 2017 10:02:07 +0100 (CET) X-Auth-Info: oSmP/XgicxiizD26z5H1AajPjLVju/KP+lXyyp6Pm9M0FuJfoKRDf0+p98jiluZc Received: from linux.local (ppp-88-217-1-86.dynamic.mnet-online.de [88.217.1.86]) by mail.mnet-online.de (Postfix) with ESMTPA; Sun, 8 Jan 2017 10:02:07 +0100 (CET) Received: by linux.local (Postfix, from userid 501) id 767401E5477; Sun, 8 Jan 2017 10:02:04 +0100 (CET) From: Andreas Schwab To: L A Walsh Subject: Re: bug#25388: Bug in ls, kills existing scripts reading "ls" -1 as input References: <587065F6.4040504@tlinx.org> X-Yow: I need to discuss BUY-BACK PROVISIONS with at least six studio SLEAZEBALLS!! Date: Sun, 08 Jan 2017 10:02:03 +0100 In-Reply-To: <587065F6.4040504@tlinx.org> (L. A. Walsh's message of "Fri, 06 Jan 2017 19:52:22 -0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 25388 Cc: 25388@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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 (/) On Jan 06 2017, L A Walsh wrote: > The new ls doesn't maintain backwards compatibility. > The default options now add extraneous quotes to > some filenames. > > Anyplace one uses 'ls -1' to read 1 file/line > now breaks. > > This is a regression as it breaks existing > scripts and behavior. Does it? $ touch 'a b' $ ls -1 | grep "'" Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 09 00:21:58 2017 Received: (at 25388) by debbugs.gnu.org; 9 Jan 2017 05:21:58 +0000 Received: from localhost ([127.0.0.1]:47346 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQSP8-0003t9-4S for submit@debbugs.gnu.org; Mon, 09 Jan 2017 00:21:58 -0500 Received: from ishtar.tlinx.org ([173.164.175.65]:40744 helo=Ishtar.sc.tlinx.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQSP6-0003t0-Do for 25388@debbugs.gnu.org; Mon, 09 Jan 2017 00:21:56 -0500 Received: from [192.168.3.12] (Athenae [192.168.3.12]) by Ishtar.sc.tlinx.org (8.14.7/8.14.4/SuSE Linux 0.8) with ESMTP id v095Lq5S022536; Sun, 8 Jan 2017 21:21:54 -0800 Message-ID: <58731DF0.7030609@tlinx.org> Date: Sun, 08 Jan 2017 21:21:52 -0800 From: L A Walsh User-Agent: Thunderbird MIME-Version: 1.0 To: Andreas Schwab Subject: Re: bug#25388: Bug in ls, kills existing scripts reading "ls" -1 as input References: <587065F6.4040504@tlinx.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -3.2 (---) X-Debbugs-Envelope-To: 25388 Cc: 25388@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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.2 (---) Andreas Schwab wrote: > On Jan 06 2017, L A Walsh wrote: >> The new ls doesn't maintain backwards compatibility. >> The default options now add extraneous quotes to >> some filenames. --- > Does it? > > $ touch 'a b' > $ ls -1 | grep "'" ---- Sorry, you are right. The problem is 'ls' doesn't show the same information on the screen when it is passed through a pager like "less" or "more". In all but the smallest of directories, it's virtually a requirement to page directory output using 'more' or 'less'. Having 'ls' show different output through a pager than it does when scrolling off the screen is not a standard feature. The user has no idea how to page through 'ls's output as they saw it scroll by on the screen. It's inconsistent with any other tools that work with pagers as well as being inconsistent with itself in how it handles COLOR options. 'ls' should default to its regular behavior and only engage quoting when asked to. Let distros and users decide what to enable to add new behaviors -- like the various color options. My distro added color by default in their defaults w/it only on when output is not a pipe. I changed it on my machine to put out color even if through a pipe as I usually am piping it through 'less' and I want to see the color. If I want no color -- I can get the normal text by adding a backslash before the command. The new quoting also messes up copy/pasting into any place other than the shell. I tend to copy/paste between a shell and gvim when doing script development. I wouldn't mind having such a switch as an option, but it is usually the case that I can copy/paste between windows and have it pick up whether or not a tab or a space was used. Having tabs converted to a shell code would prevent them being expanded anyplace but in the same shell. Follow the example of COLOR and let users (including distros) decide what to enable. It will let those who want such to have it on, but not cause confusion or compatibility problems. From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 09 00:25:32 2017 Received: (at 25388) by debbugs.gnu.org; 9 Jan 2017 05:25:32 +0000 Received: from localhost ([127.0.0.1]:47350 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQSSa-0003yt-Jo for submit@debbugs.gnu.org; Mon, 09 Jan 2017 00:25:32 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:58020) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQSSY-0003yf-UT for 25388@debbugs.gnu.org; Mon, 09 Jan 2017 00:25:31 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id F00B8160075; Sun, 8 Jan 2017 21:25:24 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id ZfK1XN325Fu2; Sun, 8 Jan 2017 21:25:24 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 4B456160083; Sun, 8 Jan 2017 21:25:24 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id P1ZNmFL6nqiO; Sun, 8 Jan 2017 21:25:24 -0800 (PST) Received: from [192.168.1.9] (unknown [47.153.178.162]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 2BF58160075; Sun, 8 Jan 2017 21:25:24 -0800 (PST) Subject: Re: bug#25388: Bug in ls, kills existing scripts reading "ls" -1 as input To: L A Walsh , Andreas Schwab References: <587065F6.4040504@tlinx.org> <58731DF0.7030609@tlinx.org> From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: Date: Sun, 8 Jan 2017 21:25:23 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <58731DF0.7030609@tlinx.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -3.2 (---) X-Debbugs-Envelope-To: 25388 Cc: 25388@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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.2 (---) L A Walsh wrote: > Having 'ls' show different output through a pager > than it does when scrolling off the screen is not a standard > feature Sure it is. 'ls' has done that since then 1980s. 'ls' shows multicolumn output when the output is a tty, and single-column output when piped into a pager. From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 09 13:48:54 2017 Received: (at 25388) by debbugs.gnu.org; 9 Jan 2017 18:48:54 +0000 Received: from localhost ([127.0.0.1]:48039 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQf02-00031v-B7 for submit@debbugs.gnu.org; Mon, 09 Jan 2017 13:48:54 -0500 Received: from ishtar.tlinx.org ([173.164.175.65]:60594 helo=Ishtar.sc.tlinx.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQf00-00031n-PP for 25388@debbugs.gnu.org; Mon, 09 Jan 2017 13:48:53 -0500 Received: from [192.168.3.12] (Athenae [192.168.3.12]) by Ishtar.sc.tlinx.org (8.14.7/8.14.4/SuSE Linux 0.8) with ESMTP id v09Imdab017242; Mon, 9 Jan 2017 10:48:41 -0800 Message-ID: <5873DB07.8090007@tlinx.org> Date: Mon, 09 Jan 2017 10:48:39 -0800 From: L A Walsh User-Agent: Thunderbird MIME-Version: 1.0 To: Paul Eggert Subject: Re: bug#25388: Bug in ls, kills existing scripts reading "ls" -1 as input References: <587065F6.4040504@tlinx.org> <58731DF0.7030609@tlinx.org> In-Reply-To: Content-Type: multipart/mixed; boundary="------------040301090509070807060509" X-Spam-Score: -3.2 (---) X-Debbugs-Envelope-To: 25388 Cc: Andreas Schwab , 25388@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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.2 (---) This is a multi-part message in MIME format. --------------040301090509070807060509 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Paul Eggert wrote: > L A Walsh wrote: > >> Having 'ls' show different output through a pager >> than it does when scrolling off the screen is not a standard >> feature > > Sure it is. 'ls' has done that since then 1980s. 'ls' shows multicolumn > output when the output is a tty, and single-column output when piped > into a pager. > ---- That's not what I'm used to: Ishtar:/tmp/tmp> ls 12345678 a.exe* cccccccccccc.tar ssh-3LKwkRvOQM/ UiGUI_log_20161216-1442.htm bbbbbbbbb.gz ddddddddddddddd tall/ Ishtar:/tmp/tmp> ls |more 12345678 a.exe* cccccccccccc.tar ssh-3LKwkRvOQM/ UiGUI_log_20161216-1442.htm bbbbbbbbb.gz ddddddddddddddd tall/ Ishtar:/tmp/tmp> ls >../tmpdir.txt Ishtar:/tmp/tmp> wc ../tmpdir.txt 2 8 235 ../tmpdir.txt i.e. they look the same either way -- even down to the same colors (attaching tmpdir.txt which should display as above but with color)... depends on your LS_COLOR settings... Will include that here (very long line): export LS_COLORS='*~=01;30:*.bak=01;30:*.orig=01;30:no=00:fi=00:di=01;35:ln=01;36:pi=40;33:so=04;01;34:do=04;01;34:bd=40;33;01:cd=40;33;01:or=41;33;01:su=01;04;36:sg=01;04;35:ca=01;04;36:tw=30;42:ow=34;42:st=37;44:ex=00;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tlzma=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.rpm*=01\:30:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;3 5:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:' ls alias on my machines: alias ls='ls -CF --show-control-chars --color=always' --------------040301090509070807060509 Content-Type: text/plain; name="tmpdir.txt" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="tmpdir.txt" G1swbRtbMDBtMTIzNDU2NzgbWzBtICAgICAgICAgICAgICAgICAgICAgG1swMDszMm1hLmV4 ZRtbMG0qICAgICAgICAbWzAxOzMxbWNjY2NjY2NjY2NjYy50YXIbWzBtICAbWzAxOzM1bXNz aC0zTEt3a1J2T1FNG1swbS8KG1swMG1VaUdVSV9sb2dfMjAxNjEyMTYtMTQ0Mi5odG0bWzBt ICAbWzAxOzMxbWJiYmJiYmJiYi5nehtbMG0gIBtbMDBtZGRkZGRkZGRkZGRkZGRkG1swbSAg IBtbMzA7NDJtdGFsbBtbMG0vCg== --------------040301090509070807060509-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 09 14:00:25 2017 Received: (at 25388) by debbugs.gnu.org; 9 Jan 2017 19:00:25 +0000 Received: from localhost ([127.0.0.1]:48048 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQfBB-0003Jz-Lj for submit@debbugs.gnu.org; Mon, 09 Jan 2017 14:00:25 -0500 Received: from ishtar.tlinx.org ([173.164.175.65]:60940 helo=Ishtar.sc.tlinx.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQfB9-0003Jr-Q5 for 25388@debbugs.gnu.org; Mon, 09 Jan 2017 14:00:24 -0500 Received: from [192.168.3.12] (Athenae [192.168.3.12]) by Ishtar.sc.tlinx.org (8.14.7/8.14.4/SuSE Linux 0.8) with ESMTP id v09J0KRb018575; Mon, 9 Jan 2017 11:00:22 -0800 Message-ID: <5873DDC4.3070403@tlinx.org> Date: Mon, 09 Jan 2017 11:00:20 -0800 From: L A Walsh User-Agent: Thunderbird MIME-Version: 1.0 To: Paul Eggert Subject: Re: bug#25388: Bug in ls, kills existing scripts reading "ls" -1 as input References: <587065F6.4040504@tlinx.org> <58731DF0.7030609@tlinx.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -3.2 (---) X-Debbugs-Envelope-To: 25388 Cc: Andreas Schwab , 25388@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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.2 (---) Paul Eggert wrote: > L A Walsh wrote: >> Having 'ls' show different output through a pager than it >> does when scrolling off the screen is not a standard feature. > > Sure it is. 'ls' has done that since then 1980s. 'ls' shows multicolumn > output when the output is a tty, and single-column output when piped > into a pager. ---- That would be really annoying if it were true. It doesn't do that on any of my *nix terms. When I put it through a pager I want it to page the output I just saw. That's what it's for. I.e. using a pager, should not, by default, change the output of programs. It's purpose is to moderate the output stream so a user can read what was output when they ran it without the pager. Changing the output, by default, depending on pager usage defeats the primary purpose of pagers. If it became common place for programs to detect pager use and generate different output, it would seriously harm the intended use of pagers, since you would no longer be able to page the output of those programs (since what you are paging isn't the original output). FWIW: If I want 1-column output, I usually use "-1". That's what it is for, no? -l From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 09 14:07:50 2017 Received: (at 25388) by debbugs.gnu.org; 9 Jan 2017 19:07:51 +0000 Received: from localhost ([127.0.0.1]:48056 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQfIM-0003V6-OF for submit@debbugs.gnu.org; Mon, 09 Jan 2017 14:07:50 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:45824) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQfIK-0003Uq-FP for 25388@debbugs.gnu.org; Mon, 09 Jan 2017 14:07:49 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 8A6121600B5; Mon, 9 Jan 2017 11:07:42 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id Q4iBvNMdw21R; Mon, 9 Jan 2017 11:07:41 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id D2FE11600CF; Mon, 9 Jan 2017 11:07:41 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id WW6CTzdlMJM3; Mon, 9 Jan 2017 11:07:41 -0800 (PST) Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id BB1681600B5; Mon, 9 Jan 2017 11:07:41 -0800 (PST) Subject: Re: bug#25388: Bug in ls, kills existing scripts reading "ls" -1 as input To: L A Walsh References: <587065F6.4040504@tlinx.org> <58731DF0.7030609@tlinx.org> <5873DB07.8090007@tlinx.org> From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: Date: Mon, 9 Jan 2017 11:07:41 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <5873DB07.8090007@tlinx.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -3.2 (---) X-Debbugs-Envelope-To: 25388 Cc: Andreas Schwab , 25388@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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.2 (---) On 01/09/2017 10:48 AM, L A Walsh wrote: > That's not what I'm used to: I couldn't parse your email. I was describing the common behavior in BSD and GNU/Linux for ages, like this: $ touch a b $ ls a b $ ls | more a b From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 09 14:33:31 2017 Received: (at 25388) by debbugs.gnu.org; 9 Jan 2017 19:33:31 +0000 Received: from localhost ([127.0.0.1]:48063 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQfhC-00047o-Qt for submit@debbugs.gnu.org; Mon, 09 Jan 2017 14:33:31 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35726) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQfhA-00047T-3H for 25388@debbugs.gnu.org; Mon, 09 Jan 2017 14:33:28 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C1D1261B86; Mon, 9 Jan 2017 19:33:22 +0000 (UTC) Received: from [10.10.118.201] (ovpn-118-201.rdu2.redhat.com [10.10.118.201]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v09JXLUR016594; Mon, 9 Jan 2017 14:33:21 -0500 Subject: Re: bug#25388: Bug in ls, kills existing scripts reading "ls" -1 as input To: L A Walsh , Paul Eggert References: <587065F6.4040504@tlinx.org> <58731DF0.7030609@tlinx.org> <5873DDC4.3070403@tlinx.org> From: Eric Blake Openpgp: url=http://people.redhat.com/eblake/eblake.gpg Organization: Red Hat, Inc. Message-ID: Date: Mon, 9 Jan 2017 13:33:19 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <5873DDC4.3070403@tlinx.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="aNPSArIbOPSVVQbNX7VlgibKI3QvDLNna" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 09 Jan 2017 19:33:23 +0000 (UTC) X-Spam-Score: -8.2 (--------) X-Debbugs-Envelope-To: 25388 Cc: Andreas Schwab , 25388@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -8.2 (--------) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --aNPSArIbOPSVVQbNX7VlgibKI3QvDLNna Content-Type: multipart/mixed; boundary="gpbtTFUlATH0XGClfNAc8NJwfDWuAv5oC"; protected-headers="v1" From: Eric Blake To: L A Walsh , Paul Eggert Cc: Andreas Schwab , 25388@debbugs.gnu.org Message-ID: Subject: Re: bug#25388: Bug in ls, kills existing scripts reading "ls" -1 as input References: <587065F6.4040504@tlinx.org> <58731DF0.7030609@tlinx.org> <5873DDC4.3070403@tlinx.org> In-Reply-To: <5873DDC4.3070403@tlinx.org> --gpbtTFUlATH0XGClfNAc8NJwfDWuAv5oC Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 01/09/2017 01:00 PM, L A Walsh wrote: > Paul Eggert wrote: >> L A Walsh wrote: >>> Having 'ls' show different output through a pager than it >>> does when scrolling off the screen is not a standard feature. >> >> Sure it is. 'ls' has done that since then 1980s. 'ls' shows >> multicolumn output when the output is a tty, and single-column output >> when piped into a pager. > ---- > That would be really annoying if it were true. It doesn't do that > on any of my *nix terms. When I put it through a pager I want it to pa= ge > the output I just saw. That's what it's for. But that's EXACTLY what POSIX has specified, because it has been existing practice for YEARS. http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ls.html "STDOUT The default format shall be to list one entry per line to standard output; the exceptions are to terminals or when one of the -C, -m, or -x options is specified. If the output is to a terminal, the format is implementation-defined. " And POSIX merely codified existing practice (this is nothing new - it has been this way since the 70's) - the earliest versions of ls used isatty(), and implicitly turned on at least -q if stdout was a terminal or -1 if it was not, which means that you have ALWAYS had different behavior between 'ls' and 'ls | more', at least when ls is not some alias that explicitly specifies other command line options to override the defaults. The GNU Coding Standards explicitly discourage NEW programs from changing default behavior based solely on whether stdout is a tty or not, but existing programs like ls are grandfathered in to have their historical behavior, which predates the GNU Coding Standards. >=20 > I.e. using a pager, should not, by default, change the output > of programs. It's purpose is to moderate the output stream > so a user can read what was output when they ran it without > the pager. Changing the output, by default, depending on > pager usage defeats the primary purpose of pagers. I agree that it is not nice to change output merely based on the type of fd that stdout is, and GNU Coding Standards agrees in general. But like it or not, that's precisely what happens in ls due to backwards-compatibility - using a pager through a pipeline changes stdout from being a tty to instead being a pipeline, and therefore changes default output of at least 'ls', and such change in behavior is POSIX-compliant. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --gpbtTFUlATH0XGClfNAc8NJwfDWuAv5oC-- --aNPSArIbOPSVVQbNX7VlgibKI3QvDLNna 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/ iQEcBAEBCAAGBQJYc+WAAAoJEKeha0olJ0NqCxIH/042lZJVSYii2HyhIRxiHp3D Rvk47Ma6BMIKOLyUV44CKNSgZ04AbS7RUbAXwn7huH9wdTp+yY/HN6tT4MT7pkWp oSG+k3D24O3qoX5D0mGosEmR5pCT3LJ955Pr0IE3uI3zQWfWT5rQITf1kXQ2rsmB p0uBk603uuex7mfpO0LA7yAXVc003m4OBKBaXUQo01jS3+JG5y4yjtLnF06mlJCc ERDFPtSRMICUfEJxcMYz4tl4bYgt0vLd5SaMZqQGgNGXHNPqrX7w3Fq3OkS4GjhB wVmmbAjmVIAl62InkDthe55YGRNVclv3IViOBe0CwfzzeE9gTn1zLwLbT/4K6h0= =GkQD -----END PGP SIGNATURE----- --aNPSArIbOPSVVQbNX7VlgibKI3QvDLNna-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 09 14:38:36 2017 Received: (at 25388) by debbugs.gnu.org; 9 Jan 2017 19:38:36 +0000 Received: from localhost ([127.0.0.1]:48067 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQfm8-0004FS-Fw for submit@debbugs.gnu.org; Mon, 09 Jan 2017 14:38:36 -0500 Received: from ishtar.tlinx.org ([173.164.175.65]:34138 helo=Ishtar.sc.tlinx.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQfm7-0004FK-97 for 25388@debbugs.gnu.org; Mon, 09 Jan 2017 14:38:35 -0500 Received: from [192.168.3.12] (Athenae [192.168.3.12]) by Ishtar.sc.tlinx.org (8.14.7/8.14.4/SuSE Linux 0.8) with ESMTP id v09JcTLe022323; Mon, 9 Jan 2017 11:38:31 -0800 Message-ID: <5873E6B5.4000807@tlinx.org> Date: Mon, 09 Jan 2017 11:38:29 -0800 From: L A Walsh User-Agent: Thunderbird MIME-Version: 1.0 To: Paul Eggert Subject: Re: bug#25388: Bug in ls, kills existing scripts reading "ls" -1 as input References: <587065F6.4040504@tlinx.org> <58731DF0.7030609@tlinx.org> <5873DB07.8090007@tlinx.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -3.2 (---) X-Debbugs-Envelope-To: 25388 Cc: Andreas Schwab , 25388@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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.2 (---) Paul Eggert wrote: > On 01/09/2017 10:48 AM, L A Walsh wrote: >> That's not what I'm used to: > > I couldn't parse your email. --- 1) I ran the ls command on a directory, shows 4 columns (that were in color). Ishtar:/tmp/tmp> ls 12345678 a.exe* cccccccccccc.tar ssh-3LKwkRvOQM/ UiGUI_log_20161216-1442.htm bbbbbbbbb.gz ddddddddddddddd tall/ 2) Next I ran the same ls command through more (really 'less' -- something set @ distro level, but found convenient, so kept it). Output is identical. Ishtar:/tmp/tmp> ls |more 12345678 a.exe* cccccccccccc.tar ssh-3LKwkRvOQM/ UiGUI_log_20161216-1442.htm bbbbbbbbb.gz ddddddddddddddd tall/ 3) Then I ran the same command and sent it to a file (which I attached to the email) and ran 'wc' on it -- which showed it had 2 lines and 8 "words" (filenames in this case). Ishtar:/tmp/tmp> ls >../tmpdir.txt Ishtar:/tmp/tmp> wc ../tmpdir.txt 2 8 235 ../tmpdir.txt I was describing the common behavior in BSD > and GNU/Linux for ages, like this: > > $ touch a b > $ ls > a b > $ ls | more > a > b ---- When I do the same, I get this: > ls a b > ls | more a b Which is how it has been for over 15 years on linux on my machines. If my problem is that the 'ls' listing scrolled off the screen too fast for me to read, then the "default" behavior (that you describe) doesn't seem well thought out. If a user couldn't read it in multi-column mode, what would prompt anyone to think that they would automatically want it in 1-column mode when they put it through a pager -- doesn't make sense. If I wanted 1 column format, why wouldn't I use "-1". That's the entire purpose of the switch. Again, I state that showing different output through a pager vs. what was shot out to the screen could allow a security problem in the form of a stenographic attack. While dumping the output to a screen, maybe, a SW hack couldn't be covered up, but if they altered the sources of 'more/less', to hide their tracks, it would be noticeably harder to find. It's not good practice, IMO, to be altering output based on what (or who) is reading it (at least not by default). From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 09 14:44:50 2017 Received: (at 25388) by debbugs.gnu.org; 9 Jan 2017 19:44:50 +0000 Received: from localhost ([127.0.0.1]:48071 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQfsA-0004OY-5X for submit@debbugs.gnu.org; Mon, 09 Jan 2017 14:44:50 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36396) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQfs8-0004OJ-8u for 25388@debbugs.gnu.org; Mon, 09 Jan 2017 14:44:48 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AE92B8E223; Mon, 9 Jan 2017 19:44:43 +0000 (UTC) Received: from [10.10.118.201] (ovpn-118-201.rdu2.redhat.com [10.10.118.201]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v09Jig42026546; Mon, 9 Jan 2017 14:44:43 -0500 Subject: Re: bug#25388: Bug in ls, kills existing scripts reading "ls" -1 as input To: L A Walsh , Paul Eggert References: <587065F6.4040504@tlinx.org> <58731DF0.7030609@tlinx.org> <5873DB07.8090007@tlinx.org> From: Eric Blake Openpgp: url=http://people.redhat.com/eblake/eblake.gpg Organization: Red Hat, Inc. Message-ID: Date: Mon, 9 Jan 2017 13:44:41 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <5873DB07.8090007@tlinx.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="wOBb909BtI2vn7HB7bfBB54PvPq9f8UFq" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 09 Jan 2017 19:44:43 +0000 (UTC) X-Spam-Score: -8.2 (--------) X-Debbugs-Envelope-To: 25388 Cc: Andreas Schwab , 25388@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -8.2 (--------) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --wOBb909BtI2vn7HB7bfBB54PvPq9f8UFq Content-Type: multipart/mixed; boundary="iveWIRWGmIN9RATdnLEvhGmO6j0So3hAi"; protected-headers="v1" From: Eric Blake To: L A Walsh , Paul Eggert Cc: Andreas Schwab , 25388@debbugs.gnu.org Message-ID: Subject: Re: bug#25388: Bug in ls, kills existing scripts reading "ls" -1 as input References: <587065F6.4040504@tlinx.org> <58731DF0.7030609@tlinx.org> <5873DB07.8090007@tlinx.org> In-Reply-To: <5873DB07.8090007@tlinx.org> --iveWIRWGmIN9RATdnLEvhGmO6j0So3hAi Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 01/09/2017 12:48 PM, L A Walsh wrote: >> Sure it is. 'ls' has done that since then 1980s. 'ls' shows >> multicolumn output when the output is a tty, and single-column output >> when piped into a pager. >> > ---- > That's not what I'm used to: > ls alias on my machines: > alias ls=3D'ls -CF --show-control-chars --color=3Dalways' That's because you are using an alias to alter 'ls' to non-default behavior for your personal default. Try again with '\ls' everywhere you previously used 'ls', and you will see that output to the terminal is different than output to a file or pipeline. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --iveWIRWGmIN9RATdnLEvhGmO6j0So3hAi-- --wOBb909BtI2vn7HB7bfBB54PvPq9f8UFq 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/ iQEcBAEBCAAGBQJYc+gpAAoJEKeha0olJ0NqVGoH+wToNTykEG4uyaM/rSpsMiFm u2veag2u9remB4315ac/4eLBkO+yzJD07vmeLbsbIY6jKmytQ5og2TPknYUMjVqb eDl88V2tMOiNSaqHIbLTBNgXXcRifQqNWd07/T7W5riPUcHl+gHIXqfp4bA4Y/Ur +PnRct4xI/WkBe0qoxUnQ4fV686m9emkU17V2XRHWnLM+evn+++PjsFk+kQvOoTA 5gObt9IYBWNvHQ6LBQs+KjqC0sWUjjgY9KkQTITYdoePCgtEP+Wb84OG9Fd2Byni E0oZquSCrXI83UOHGArC2nEQoRyURsaC2Y+lpB+xwEpDn0koxTBI23RzIuWMLXo= =kV1C -----END PGP SIGNATURE----- --wOBb909BtI2vn7HB7bfBB54PvPq9f8UFq-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 09 14:47:25 2017 Received: (at 25388) by debbugs.gnu.org; 9 Jan 2017 19:47:25 +0000 Received: from localhost ([127.0.0.1]:48075 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQfuf-0004TA-JA for submit@debbugs.gnu.org; Mon, 09 Jan 2017 14:47:25 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59548) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQfud-0004Sv-HY for 25388@debbugs.gnu.org; Mon, 09 Jan 2017 14:47:24 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2115F7F7A5; Mon, 9 Jan 2017 19:47:19 +0000 (UTC) Received: from [10.10.118.201] (ovpn-118-201.rdu2.redhat.com [10.10.118.201]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v09JlItv025668; Mon, 9 Jan 2017 14:47:18 -0500 Subject: Re: bug#25388: Bug in ls, kills existing scripts reading "ls" -1 as input To: L A Walsh , Paul Eggert References: <587065F6.4040504@tlinx.org> <58731DF0.7030609@tlinx.org> <5873DB07.8090007@tlinx.org> <5873E6B5.4000807@tlinx.org> From: Eric Blake Openpgp: url=http://people.redhat.com/eblake/eblake.gpg Organization: Red Hat, Inc. Message-ID: Date: Mon, 9 Jan 2017 13:47:16 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <5873E6B5.4000807@tlinx.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ovwVc0glrttm1WxNmTJKl3QmhseDMXniw" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 09 Jan 2017 19:47:19 +0000 (UTC) X-Spam-Score: -8.2 (--------) X-Debbugs-Envelope-To: 25388 Cc: Andreas Schwab , 25388@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -8.2 (--------) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --ovwVc0glrttm1WxNmTJKl3QmhseDMXniw Content-Type: multipart/mixed; boundary="06U6G9uSS01v9Ma4BuFKKCnog41Ls9U8m"; protected-headers="v1" From: Eric Blake To: L A Walsh , Paul Eggert Cc: Andreas Schwab , 25388@debbugs.gnu.org Message-ID: Subject: Re: bug#25388: Bug in ls, kills existing scripts reading "ls" -1 as input References: <587065F6.4040504@tlinx.org> <58731DF0.7030609@tlinx.org> <5873DB07.8090007@tlinx.org> <5873E6B5.4000807@tlinx.org> In-Reply-To: <5873E6B5.4000807@tlinx.org> --06U6G9uSS01v9Ma4BuFKKCnog41Ls9U8m Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 01/09/2017 01:38 PM, L A Walsh wrote: >=20 >=20 > Paul Eggert wrote: >> On 01/09/2017 10:48 AM, L A Walsh wrote: >>> That's not what I'm used to:=20 >> >> I couldn't parse your email.=20 > --- > 1) I ran the ls command on a directory, shows 4 columns (that were in= > color). That right there is a clue that your 'ls' is a non-standard alias that is adding additional command lines. 'ls' by default does not output in color. > 2) Next I ran the same ls command through more (really 'less' -- someth= ing > set @ distro level, but found convenient, so kept it). Output is > identical. Again, output is identical BECAUSE of your alias. But if you run: \ls | more you will get DIFFERENT output. > It's not good practice, IMO, to be altering output based on > what (or who) is reading it (at least not by default). Good or not, it IS what happens, and we can't change it due to years of usage. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --06U6G9uSS01v9Ma4BuFKKCnog41Ls9U8m-- --ovwVc0glrttm1WxNmTJKl3QmhseDMXniw 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/ iQEcBAEBCAAGBQJYc+jEAAoJEKeha0olJ0Nqv4kH/36aYyO+E224BOgSl2VRIlwy QzYNGiZl2xIVSbeBHFwQKI65DHH6tujG3avZYb75NvAfFLsLINWEXR/JWDq+8tgk Si/Ve3+YQdhfXLzIvWcqTyKlVhegWeTqk0L9aOJldalaIVqrNL4yJH4AfLdF/nW7 gQQE1GpmIn7sIt5brctDtKRtkxXnpW4Rwtbvlz66EvtfKkc6CuV8rkYdbo4iXq9T pvYvsuvCqNxhNKOcTj3Kw5P455nFBiahok2R+MKIkGm4aTvlIgnyD66HAiztHclO 0hPvSJZuCf/Y2x8pY+SwVgzeSUP+LUICVJLGv/c2UUsrTWIL9XmfNyPHkGAgMWo= =pyIT -----END PGP SIGNATURE----- --ovwVc0glrttm1WxNmTJKl3QmhseDMXniw-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 09 14:53:19 2017 Received: (at 25388) by debbugs.gnu.org; 9 Jan 2017 19:53:19 +0000 Received: from localhost ([127.0.0.1]:48079 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQg0N-0004bV-83 for submit@debbugs.gnu.org; Mon, 09 Jan 2017 14:53:19 -0500 Received: from ishtar.tlinx.org ([173.164.175.65]:36102 helo=Ishtar.sc.tlinx.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQg0K-0004bH-4k for 25388@debbugs.gnu.org; Mon, 09 Jan 2017 14:53:17 -0500 Received: from [192.168.3.12] (Athenae [192.168.3.12]) by Ishtar.sc.tlinx.org (8.14.7/8.14.4/SuSE Linux 0.8) with ESMTP id v09JrCfT025547; Mon, 9 Jan 2017 11:53:14 -0800 Message-ID: <5873EA28.9090905@tlinx.org> Date: Mon, 09 Jan 2017 11:53:12 -0800 From: L A Walsh User-Agent: Thunderbird MIME-Version: 1.0 To: Eric Blake Subject: Re: bug#25388: Bug in ls, kills existing scripts reading "ls" -1 as input References: <587065F6.4040504@tlinx.org> <58731DF0.7030609@tlinx.org> <5873DDC4.3070403@tlinx.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -3.2 (---) X-Debbugs-Envelope-To: 25388 Cc: Paul Eggert , Andreas Schwab , 25388@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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.2 (---) Eric Blake wrote: > But that's EXACTLY what POSIX has specified, because it has been > existing practice for YEARS. --- A bit louder Eric, you can't be heard. > > http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ls.html > "STDOUT > The default format shall be to list one entry per line to standard > output; the exceptions are to terminals or when one of the -C, -m, or -x > options is specified. If the output is to a terminal, the format is > implementation-defined. --- Perhaps you could read my email -- especially the part where I listed the alias I use for running 'ls'. > And POSIX merely codified existing practice (this is nothing new - it > has been this way since the 70's) --- Not anymore. Breaking "rm -fr ." wasn't an existing practice except at BSD-using dists (like BSD & SunOS). While Solaris was SysV, since it was bought up, it has changed. > The GNU Coding Standards explicitly discourage NEW programs from > changing default behavior based solely on whether stdout is a tty or > not, but existing programs like ls are grandfathered in to have their > historical behavior, which predates the GNU Coding Standards. --- Good -- that makes the issue pretty black & white. Given those standards, then adding a NEW behavior that does change the output depending on destination being tty or not would be "explicitly discouraged". Making the matter more clear is that it is NOT a case of grandfathering in a "historic behavior" > I agree that it is not nice to change output merely based on the type of > fd that stdout is, and GNU Coding Standards agrees in general. But like > it or not, that's precisely what happens in ls due to > backwards-compatibility. --- The old behavior of multi or single columns may be historical and backwards compat -- I have no problem with that. *However*, the new behavior of adding new-shell-encoded output as the default is not historical. It encodes output for bash and other new shells -- hindering cut&paste to other programs. From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 09 14:57:35 2017 Received: (at 25388) by debbugs.gnu.org; 9 Jan 2017 19:57:35 +0000 Received: from localhost ([127.0.0.1]:48083 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQg4U-0004hg-T1 for submit@debbugs.gnu.org; Mon, 09 Jan 2017 14:57:35 -0500 Received: from ishtar.tlinx.org ([173.164.175.65]:36230 helo=Ishtar.sc.tlinx.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQg4T-0004hY-54 for 25388@debbugs.gnu.org; Mon, 09 Jan 2017 14:57:33 -0500 Received: from [192.168.3.12] (Athenae [192.168.3.12]) by Ishtar.sc.tlinx.org (8.14.7/8.14.4/SuSE Linux 0.8) with ESMTP id v09JvTQo026246; Mon, 9 Jan 2017 11:57:31 -0800 Message-ID: <5873EB29.4080906@tlinx.org> Date: Mon, 09 Jan 2017 11:57:29 -0800 From: L A Walsh User-Agent: Thunderbird MIME-Version: 1.0 To: Eric Blake Subject: Re: bug#25388: Bug in ls, kills existing scripts reading "ls" -1 as input References: <587065F6.4040504@tlinx.org> <58731DF0.7030609@tlinx.org> <5873DB07.8090007@tlinx.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -3.2 (---) X-Debbugs-Envelope-To: 25388 Cc: Paul Eggert , Andreas Schwab , 25388@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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.2 (---) Eric Blake wrote: > On 01/09/2017 12:48 PM, L A Walsh wrote: > >>> Sure it is. 'ls' has done that since then 1980s. 'ls' shows >>> multicolumn output when the output is a tty, and single-column output >>> when piped into a pager. >>> >> ---- >> That's not what I'm used to: > >> ls alias on my machines: >> alias ls='ls -CF --show-control-chars --color=always' > > That's because you are using an alias to alter 'ls' to non-default > behavior for your personal default. > > Try again with '\ls' everywhere you previously used 'ls', and you will > see that output to the terminal is different than output to a file or > pipeline. --- Gee guess you missed my 1st response to Andreas: > I changed it on my machine to put out color > even if through a pipe as I usually am piping it through > 'less' and I want to see the color. If I want no color -- > I can get the normal text by adding a backslash before > the command. --- So 'backslash' usage -- got that -- disables alias usage. Thanks. :-) From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 09 15:00:50 2017 Received: (at 25388) by debbugs.gnu.org; 9 Jan 2017 20:00:50 +0000 Received: from localhost ([127.0.0.1]:48087 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQg7e-0004nq-C0 for submit@debbugs.gnu.org; Mon, 09 Jan 2017 15:00:50 -0500 Received: from ishtar.tlinx.org ([173.164.175.65]:36388 helo=Ishtar.sc.tlinx.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQg7d-0004nj-E4 for 25388@debbugs.gnu.org; Mon, 09 Jan 2017 15:00:49 -0500 Received: from [192.168.3.12] (Athenae [192.168.3.12]) by Ishtar.sc.tlinx.org (8.14.7/8.14.4/SuSE Linux 0.8) with ESMTP id v09K0jJb027024; Mon, 9 Jan 2017 12:00:47 -0800 Message-ID: <5873EBED.2030800@tlinx.org> Date: Mon, 09 Jan 2017 12:00:45 -0800 From: L A Walsh User-Agent: Thunderbird MIME-Version: 1.0 To: Eric Blake Subject: Re: bug#25388: Bug in ls, kills existing scripts reading "ls" -1 as input References: <587065F6.4040504@tlinx.org> <58731DF0.7030609@tlinx.org> <5873DB07.8090007@tlinx.org> <5873E6B5.4000807@tlinx.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -3.2 (---) X-Debbugs-Envelope-To: 25388 Cc: Paul Eggert , Andreas Schwab , 25388@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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.2 (---) Eric Blake wrote: > Good or not, it IS what happens, and we can't change it due to years of > usage. ---- You are coming into the middle of the discussion. I wasn't asking for a change to _that_ specific behavior. I'm against adding more/new behaviors that also change output and do it by default. From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 09 15:08:00 2017 Received: (at 25388) by debbugs.gnu.org; 9 Jan 2017 20:08:00 +0000 Received: from localhost ([127.0.0.1]:48091 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQgEa-0004yU-3s for submit@debbugs.gnu.org; Mon, 09 Jan 2017 15:08:00 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:58760) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQgEY-0004yE-ER for 25388@debbugs.gnu.org; Mon, 09 Jan 2017 15:07:59 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 5FA9D1600FD; Mon, 9 Jan 2017 12:07:52 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id zFTFkDpyEoGd; Mon, 9 Jan 2017 12:07:51 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id AA32F160103; Mon, 9 Jan 2017 12:07:51 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id N9Ldkz1fLl6w; Mon, 9 Jan 2017 12:07:51 -0800 (PST) Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 8D2161600FD; Mon, 9 Jan 2017 12:07:51 -0800 (PST) Subject: Re: bug#25388: Bug in ls, kills existing scripts reading "ls" -1 as input To: L A Walsh , Eric Blake References: <587065F6.4040504@tlinx.org> <58731DF0.7030609@tlinx.org> <5873DB07.8090007@tlinx.org> <5873E6B5.4000807@tlinx.org> <5873EBED.2030800@tlinx.org> From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: Date: Mon, 9 Jan 2017 12:07:51 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <5873EBED.2030800@tlinx.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -3.2 (---) X-Debbugs-Envelope-To: 25388 Cc: Andreas Schwab , 25388@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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.2 (---) On 01/09/2017 12:00 PM, L A Walsh wrote: > I wasn't asking for a change to _that_ specific behavior. You argued that it's not standard for 'ls' to behave differently when piping output to a pager, and that the recent change was therefore undesirable. As the premise for this argument was incorrect, it shouldn't be surprising if readers disagree with its conclusion. There are obviously advantages and disadvantages of the recent change, and we thought that the former outweighed the latter for typical users. If this isn't the case for you, you can change your personal alias to reflect your preferences. You're already using such an alias, since you already prefer alternatives to the default in other areas, so this shouldn't be much trouble. From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 09 15:10:38 2017 Received: (at 25388) by debbugs.gnu.org; 9 Jan 2017 20:10:38 +0000 Received: from localhost ([127.0.0.1]:48095 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQgH8-00052U-I5 for submit@debbugs.gnu.org; Mon, 09 Jan 2017 15:10:38 -0500 Received: from midir.magicbluesmoke.com ([82.195.144.46]:35452 helo=mail.magicbluesmoke.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQgH7-00052L-5i for 25388@debbugs.gnu.org; Mon, 09 Jan 2017 15:10:37 -0500 Received: from [192.168.1.80] (unknown [109.76.189.113]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.magicbluesmoke.com (Postfix) with ESMTPSA id E9244988A; Mon, 9 Jan 2017 20:10:32 +0000 (GMT) Subject: Re: bug#25388: Bug in ls, kills existing scripts reading "ls" -1 as input To: L A Walsh , Paul Eggert References: <587065F6.4040504@tlinx.org> <58731DF0.7030609@tlinx.org> <5873DB07.8090007@tlinx.org> From: =?UTF-8?Q?P=c3=a1draig_Brady?= Message-ID: Date: Mon, 9 Jan 2017 20:10:30 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <5873DB07.8090007@tlinx.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 25388 Cc: Andreas Schwab , 25388@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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.0 (/) tag 25388 notabug close 25388 stop On 09/01/17 18:48, L A Walsh wrote: > ls alias on my machines: > alias ls='ls -CF --show-control-chars --color=always' Note a caveat of the above is that it changes the display width depending on whether you pipe to more or not. You could avoid that by changing the alias to: alias ls='COLUMNS=$COLUMNS ls -CF --show-control-chars --color' Also you can stick a -N option in that alias to disable the default quoting. cheers, Pádraig. From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 09 15:35:53 2017 Received: (at 25388) by debbugs.gnu.org; 9 Jan 2017 20:35:53 +0000 Received: from localhost ([127.0.0.1]:48106 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQgfY-0005eg-U8 for submit@debbugs.gnu.org; Mon, 09 Jan 2017 15:35:53 -0500 Received: from ishtar.tlinx.org ([173.164.175.65]:37734 helo=Ishtar.sc.tlinx.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQgfX-0005eY-D8 for 25388@debbugs.gnu.org; Mon, 09 Jan 2017 15:35:51 -0500 Received: from [192.168.3.12] (Athenae [192.168.3.12]) by Ishtar.sc.tlinx.org (8.14.7/8.14.4/SuSE Linux 0.8) with ESMTP id v09KZkTi031044; Mon, 9 Jan 2017 12:35:48 -0800 Message-ID: <5873F422.1060708@tlinx.org> Date: Mon, 09 Jan 2017 12:35:46 -0800 From: L A Walsh User-Agent: Thunderbird MIME-Version: 1.0 To: Paul Eggert Subject: Re: bug#25388: Bug in ls, kills existing scripts reading "ls" -1 as input References: <587065F6.4040504@tlinx.org> <58731DF0.7030609@tlinx.org> <5873DB07.8090007@tlinx.org> <5873E6B5.4000807@tlinx.org> <5873EBED.2030800@tlinx.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -3.2 (---) X-Debbugs-Envelope-To: 25388 Cc: Andreas Schwab , Eric Blake , 25388@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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.2 (---) Paul Eggert wrote: > On 01/09/2017 12:00 PM, L A Walsh wrote: >> I wasn't asking for a change to _that_ specific behavior. > > You argued that it's not standard for 'ls' to behave differently when > piping output to a pager, and that the recent change was therefore > undesirable. ==== I stand corrected for the historical behavior. I also stand for it being strongly against GNU standards to add more such behaviors. > As the premise for this argument was incorrect, it > shouldn't be surprising if readers disagree with its conclusion. ---- Now you are deliberately excluding the fact. While my initial stance was that it was engaging in non-standard behavior (which is true) -- it is also the case that an exception was made for 'ls' for historical behavior. This is not historical behavior. 'ls' doesn't get a carte blanc to change output anyway it wants because of a specific historical behavior. From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 09 15:37:06 2017 Received: (at 25388) by debbugs.gnu.org; 9 Jan 2017 20:37:06 +0000 Received: from localhost ([127.0.0.1]:48110 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQggk-0005gn-5R for submit@debbugs.gnu.org; Mon, 09 Jan 2017 15:37:06 -0500 Received: from ishtar.tlinx.org ([173.164.175.65]:37788 helo=Ishtar.sc.tlinx.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQggi-0005gf-BX for 25388@debbugs.gnu.org; Mon, 09 Jan 2017 15:37:04 -0500 Received: from [192.168.3.12] (Athenae [192.168.3.12]) by Ishtar.sc.tlinx.org (8.14.7/8.14.4/SuSE Linux 0.8) with ESMTP id v09Kb0pa031112; Mon, 9 Jan 2017 12:37:02 -0800 Message-ID: <5873F46C.8020001@tlinx.org> Date: Mon, 09 Jan 2017 12:37:00 -0800 From: L A Walsh User-Agent: Thunderbird MIME-Version: 1.0 To: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= Subject: Bug in ls, kills existing scripts reading "ls" -1 as input References: <587065F6.4040504@tlinx.org> <58731DF0.7030609@tlinx.org> <5873DB07.8090007@tlinx.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -3.2 (---) X-Debbugs-Envelope-To: 25388 Cc: Paul Eggert , Andreas Schwab , 25388@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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.2 (---) How do you reopen a bug that was closed before I even replied? Pádraig Brady wrote: > tag 25388 notabug > close 25388 > stop > > On 09/01/17 18:48, L A Walsh wrote: >> ls alias on my machines: >> alias ls='ls -CF --show-control-chars --color=always' > > Note a caveat of the above is that it changes the display width > depending on whether you pipe to more or not. > You could avoid that by changing the alias to: > > alias ls='COLUMNS=$COLUMNS ls -CF --show-control-chars --color' > > Also you can stick a -N option in that alias to disable the default quoting. > > cheers, > Pádraig. > From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 09 15:39:28 2017 Received: (at 25388) by debbugs.gnu.org; 9 Jan 2017 20:39:28 +0000 Received: from localhost ([127.0.0.1]:48114 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQgj2-0005kR-Gy for submit@debbugs.gnu.org; Mon, 09 Jan 2017 15:39:28 -0500 Received: from ishtar.tlinx.org ([173.164.175.65]:37892 helo=Ishtar.sc.tlinx.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQgiz-0005kH-Ru for 25388@debbugs.gnu.org; Mon, 09 Jan 2017 15:39:26 -0500 Received: from [192.168.3.12] (Athenae [192.168.3.12]) by Ishtar.sc.tlinx.org (8.14.7/8.14.4/SuSE Linux 0.8) with ESMTP id v09KdM5R031508; Mon, 9 Jan 2017 12:39:24 -0800 Message-ID: <5873F4FA.6070900@tlinx.org> Date: Mon, 09 Jan 2017 12:39:22 -0800 From: L A Walsh User-Agent: Thunderbird MIME-Version: 1.0 To: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= Subject: Re: bug#25388: Bug in ls, kills existing scripts reading "ls" -1 as input References: <587065F6.4040504@tlinx.org> <58731DF0.7030609@tlinx.org> <5873DB07.8090007@tlinx.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -3.2 (---) X-Debbugs-Envelope-To: 25388 Cc: Paul Eggert , Andreas Schwab , 25388@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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.2 (---) reopen 25388 thanks It's still a bug as it goes against adding new behaviors that generate different output based on destination = tty or not. Pádraig Brady wrote: > tag 25388 notabug > close 25388 > stop > > On 09/01/17 18:48, L A Walsh wrote: >> ls alias on my machines: >> alias ls='ls -CF --show-control-chars --color=always' > > Note a caveat of the above is that it changes the display width > depending on whether you pipe to more or not. > You could avoid that by changing the alias to: > > alias ls='COLUMNS=$COLUMNS ls -CF --show-control-chars --color' > > Also you can stick a -N option in that alias to disable the default quoting. > > cheers, > Pádraig. > From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 09 15:51:03 2017 Received: (at 25388) by debbugs.gnu.org; 9 Jan 2017 20:51:03 +0000 Received: from localhost ([127.0.0.1]:48122 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQguE-000622-Pq for submit@debbugs.gnu.org; Mon, 09 Jan 2017 15:51:03 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51720) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQguD-00061Y-Il for 25388@debbugs.gnu.org; Mon, 09 Jan 2017 15:51:02 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A43F5C057FA7; Mon, 9 Jan 2017 20:50:56 +0000 (UTC) Received: from [10.10.118.201] (ovpn-118-201.rdu2.redhat.com [10.10.118.201]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v09KotUa005919; Mon, 9 Jan 2017 15:50:55 -0500 Subject: Re: bug#25388: Bug in ls, kills existing scripts reading "ls" -1 as input To: L A Walsh , Paul Eggert References: <587065F6.4040504@tlinx.org> <58731DF0.7030609@tlinx.org> <5873DB07.8090007@tlinx.org> <5873E6B5.4000807@tlinx.org> <5873EBED.2030800@tlinx.org> <5873F422.1060708@tlinx.org> From: Eric Blake Openpgp: url=http://people.redhat.com/eblake/eblake.gpg Organization: Red Hat, Inc. Message-ID: <123ca499-ac24-74b6-744a-11e38e50dafe@redhat.com> Date: Mon, 9 Jan 2017 14:50:53 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <5873F422.1060708@tlinx.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="gVPJN7qTIGs94CvOvBH5C14Ead9TOemsU" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 09 Jan 2017 20:50:56 +0000 (UTC) X-Spam-Score: -8.2 (--------) X-Debbugs-Envelope-To: 25388 Cc: Andreas Schwab , 25388@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -8.2 (--------) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --gVPJN7qTIGs94CvOvBH5C14Ead9TOemsU Content-Type: multipart/mixed; boundary="uA61cdvp7VcpJdjcEHo3mFvVCPcn7WAd2"; protected-headers="v1" From: Eric Blake To: L A Walsh , Paul Eggert Cc: Andreas Schwab , 25388@debbugs.gnu.org Message-ID: <123ca499-ac24-74b6-744a-11e38e50dafe@redhat.com> Subject: Re: bug#25388: Bug in ls, kills existing scripts reading "ls" -1 as input References: <587065F6.4040504@tlinx.org> <58731DF0.7030609@tlinx.org> <5873DB07.8090007@tlinx.org> <5873E6B5.4000807@tlinx.org> <5873EBED.2030800@tlinx.org> <5873F422.1060708@tlinx.org> In-Reply-To: <5873F422.1060708@tlinx.org> --uA61cdvp7VcpJdjcEHo3mFvVCPcn7WAd2 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 01/09/2017 02:35 PM, L A Walsh wrote: > I also stand for it being strongly against GNU > standards to add more such behaviors. 'ls' did not recently add any more cases where tty output differs from non-tty output when all other things are equal in the default state. All that changed was that tty output is formatted differently than it has been in the past. And, as always, if you don't like the default, you can override it. >=20 >> As the premise for this argument was incorrect, it >> shouldn't be surprising if readers disagree with its conclusion. > ---- > Now you are deliberately excluding the fact. While my > initial stance was that it was engaging in non-standard behavior > (which is true) No, your claim that ls' behavior is non-standard has been proven to be false; I quoted the line from POSIX that explicitly permits ls to use implementation-defined behavior when outputting to a terminal, and if it is permitted by the standard, then the behavior can't be considered non-standard. It may not be what you want, but that does not make it non-standard. > -- it is also the case that an exception was > made for 'ls' for historical behavior. >=20 > This is not historical behavior. 'ls' doesn't get > a carte blanc to change output anyway it wants because of a specific > historical behavior.=20 Now you are excluding a fact. POSIX _does_ state that the output of 'ls' when targetting a tty is implementation-defined, so we _do_ get carte blanche permission to define our implementation to do what we think is the sanest default, even if our definition of sanest changes over time as we gain more experience on what types of problems trip up the most default users. The fact that ls output to a tty differs from what you get when outputting to a pipeline or file is irrelevant - ls output to a tty has ALWAYS differed from pipeline and file, when relying on the defaults. And if you don't LIKE the difference, then don't use the defaults - write your alias to override the defaults to ask explicitly for a format that does not add quoting you don't like. And remember, scripts are UNLIKELY to be broken by the recent change in what gets output to a tty, because scripts don't usually direct 'ls' output to a tty, at least not if that output is going to affect the control flow of the script (as it is, scripts that try to parse 'ls' output are generally already broken; there are much better tools for handling directory contents than trying to parse 'ls' output). --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --uA61cdvp7VcpJdjcEHo3mFvVCPcn7WAd2-- --gVPJN7qTIGs94CvOvBH5C14Ead9TOemsU 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/ iQEcBAEBCAAGBQJYc/etAAoJEKeha0olJ0NqKCsIAKHQnKsvi4uP42rzplQjijaG EhwqqLXYpQgKz3h1IJaQG1MH5RpB0hiKOn9IUIYG2tGJQRd8fVxjSN/Syz6FOtJv YUIKk+gIgKlFy9RH+mg8VH5LgYnhPPTX07oKUQ/hNwI06nPka4Xd0gr0Z+jXXshq 08cRjmQih+S9DmLgKCeBILii+VRtN/loppetU9gokrpZM/9H2O/NiuIs/RUkK2sF /6564GwI5YGXriRtYxl5GkUleLkj8FVy35z4YnK9JbjUpy+VHuMihNbn5+l59wwC EmMtHERfRMH3N7kgvo6Ax2aSAHBGkl48DYdCsE80t7MwZxZ8raZzSnCGGxmpr+w= =ukbN -----END PGP SIGNATURE----- --gVPJN7qTIGs94CvOvBH5C14Ead9TOemsU-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 09 15:52:25 2017 Received: (at 25388) by debbugs.gnu.org; 9 Jan 2017 20:52:25 +0000 Received: from localhost ([127.0.0.1]:48126 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQgvZ-000647-5d for submit@debbugs.gnu.org; Mon, 09 Jan 2017 15:52:25 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35682) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQgvY-00063w-0Z for 25388@debbugs.gnu.org; Mon, 09 Jan 2017 15:52:24 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 964544DD5F; Mon, 9 Jan 2017 20:52:19 +0000 (UTC) Received: from [10.10.118.201] (ovpn-118-201.rdu2.redhat.com [10.10.118.201]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v09KqI61027548; Mon, 9 Jan 2017 15:52:18 -0500 Subject: Re: bug#25388: Bug in ls, kills existing scripts reading "ls" -1 as input To: L A Walsh , =?UTF-8?Q?P=c3=a1draig_Brady?= References: <587065F6.4040504@tlinx.org> <58731DF0.7030609@tlinx.org> <5873DB07.8090007@tlinx.org> <5873F4FA.6070900@tlinx.org> From: Eric Blake Openpgp: url=http://people.redhat.com/eblake/eblake.gpg Organization: Red Hat, Inc. Message-ID: Date: Mon, 9 Jan 2017 14:52:17 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <5873F4FA.6070900@tlinx.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="IJvVuerErADBuEVbTNESJVpFacquQjst0" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 09 Jan 2017 20:52:19 +0000 (UTC) X-Spam-Score: -8.2 (--------) X-Debbugs-Envelope-To: 25388 Cc: Paul Eggert , Andreas Schwab , 25388@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -8.2 (--------) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --IJvVuerErADBuEVbTNESJVpFacquQjst0 Content-Type: multipart/mixed; boundary="jULwB4gF9JdjPgsfkvobcdv2j3cLRhmS0"; protected-headers="v1" From: Eric Blake To: L A Walsh , =?UTF-8?Q?P=c3=a1draig_Brady?= Cc: Paul Eggert , Andreas Schwab , 25388@debbugs.gnu.org Message-ID: Subject: Re: bug#25388: Bug in ls, kills existing scripts reading "ls" -1 as input References: <587065F6.4040504@tlinx.org> <58731DF0.7030609@tlinx.org> <5873DB07.8090007@tlinx.org> <5873F4FA.6070900@tlinx.org> In-Reply-To: <5873F4FA.6070900@tlinx.org> --jULwB4gF9JdjPgsfkvobcdv2j3cLRhmS0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 01/09/2017 02:39 PM, L A Walsh wrote: > reopen 25388 > thanks >=20 > It's still a bug as it goes against adding new behaviors that > generate different output based on destination =3D tty or not. This is NOT adding a new behavior that is based on isatty() checks. The output may differ, but there were no new isatty() checks added, therefore the new behavior is NOT a violation of GNU's stance that program output should not differ based solely on whether stdout is a tty.= --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --jULwB4gF9JdjPgsfkvobcdv2j3cLRhmS0-- --IJvVuerErADBuEVbTNESJVpFacquQjst0 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/ iQEcBAEBCAAGBQJYc/gBAAoJEKeha0olJ0NqFWQH/2K6LUvFFwfN+U5wfyL8FJ4u FMLYEMQWvEkzAGF+YCL1dXHqy52wuXaQgLrEmd5+4+0Iv4U+akkjJ2XKfWCpIHdt FadKxTGPIFOXdQD+KvGMlkgcKoU1D2knpzlOAQafTAlnERwrIQtVDgvgqbGQ1Orb KShEX8kxQNSbLoO9czOuKfXBRHXKpbkk4ezwhjhx7A4IMRifRHSzzJ+Ysab+1xMt 1CZk0r/NXOjKxvOjitGhJIkMDrJPOSkE4VylABWaqBX4gbwEwi36Zdj2SQ6FftN6 8a/6PjO2p0X8qM2mgvykCSrmDwJDvrN7xXP2ORQgjdLdWiEDc0ORn7fPX9bi3rA= =2LG/ -----END PGP SIGNATURE----- --IJvVuerErADBuEVbTNESJVpFacquQjst0-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 09 15:55:48 2017 Received: (at 25388) by debbugs.gnu.org; 9 Jan 2017 20:55:48 +0000 Received: from localhost ([127.0.0.1]:48130 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQgyq-000698-M8 for submit@debbugs.gnu.org; Mon, 09 Jan 2017 15:55:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33624) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQgyo-00068r-L2 for 25388@debbugs.gnu.org; Mon, 09 Jan 2017 15:55:47 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3378E8F230; Mon, 9 Jan 2017 20:55:42 +0000 (UTC) Received: from [10.10.118.201] (ovpn-118-201.rdu2.redhat.com [10.10.118.201]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v09KtfSW022634; Mon, 9 Jan 2017 15:55:41 -0500 Subject: Re: bug#25388: Bug in ls, kills existing scripts reading "ls" -1 as input To: L A Walsh References: <587065F6.4040504@tlinx.org> <58731DF0.7030609@tlinx.org> <5873DDC4.3070403@tlinx.org> <5873EA28.9090905@tlinx.org> From: Eric Blake Openpgp: url=http://people.redhat.com/eblake/eblake.gpg Organization: Red Hat, Inc. Message-ID: <9801e979-38af-0eb8-d8af-e8048e23835e@redhat.com> Date: Mon, 9 Jan 2017 14:55:39 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <5873EA28.9090905@tlinx.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="G7wjLK8PS5qG9FtelSetQKrDaUMtA09gd" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 09 Jan 2017 20:55:42 +0000 (UTC) X-Spam-Score: -8.2 (--------) X-Debbugs-Envelope-To: 25388 Cc: Paul Eggert , Andreas Schwab , 25388@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -8.2 (--------) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --G7wjLK8PS5qG9FtelSetQKrDaUMtA09gd Content-Type: multipart/mixed; boundary="UQH4wlKKMQwsvomokexnR0I9lx7GWauKx"; protected-headers="v1" From: Eric Blake To: L A Walsh Cc: Paul Eggert , Andreas Schwab , 25388@debbugs.gnu.org Message-ID: <9801e979-38af-0eb8-d8af-e8048e23835e@redhat.com> Subject: Re: bug#25388: Bug in ls, kills existing scripts reading "ls" -1 as input References: <587065F6.4040504@tlinx.org> <58731DF0.7030609@tlinx.org> <5873DDC4.3070403@tlinx.org> <5873EA28.9090905@tlinx.org> In-Reply-To: <5873EA28.9090905@tlinx.org> --UQH4wlKKMQwsvomokexnR0I9lx7GWauKx Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 01/09/2017 01:53 PM, L A Walsh wrote: >> And POSIX merely codified existing practice (this is nothing new - it >> has been this way since the 70's) > --- > Not anymore. >=20 > Breaking "rm -fr ." wasn't an existing practice except > at BSD-using dists (like BSD & SunOS). While Solaris was SysV, since i= t > was bought up, it has changed. Please quit trying to change the topic. My sentence about POSIX codifying the existing practice of 'ls' using different output to tty than it does to a pipeline is unrelated to your attempt to drag in 'rm' behavior to every single bug report. Whether or not 'rm' behavior changes have occurred over time, and whether such changes were codified by POSIX as existing practice, are not relevant to the current topic of 'ls' changing behavior. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --UQH4wlKKMQwsvomokexnR0I9lx7GWauKx-- --G7wjLK8PS5qG9FtelSetQKrDaUMtA09gd 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/ iQEcBAEBCAAGBQJYc/jLAAoJEKeha0olJ0NqWXUH/iQ7DTAm6OdmMjGZxZq6zBPh XaL8BPZebkjW4s2ZaCioDdIqwtSJjP0no7wmzMWIrvtnExhfn9rtk0wdRJCTiQb9 +iJNgseXx0cKBeg0Xn+AoM09vHgkLPtmyGeg01FkvHQtLKWYPcSpVFVScVTaAU7a ZS2DncPmj9zNUkJTXHHY/6LlHAYF0N7ZDyl5AVUY9MVAWJUHIfCQOEmrs/x5z12l z2ObKdpu30JylSO8pMG2GbnBULe3P3/oHl5XuceBA/2y2VX6df2gS14EuJA7H4/S 4FtBsy7qxh1djRktZOt5GohkqymHJN5JwKw4Vye+cSwmTPkNb88nYCmOrHj953w= =LDCd -----END PGP SIGNATURE----- --G7wjLK8PS5qG9FtelSetQKrDaUMtA09gd-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 09 16:22:18 2017 Received: (at 25388) by debbugs.gnu.org; 9 Jan 2017 21:22:18 +0000 Received: from localhost ([127.0.0.1]:48140 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQhOU-0006nM-8g for submit@debbugs.gnu.org; Mon, 09 Jan 2017 16:22:18 -0500 Received: from ishtar.tlinx.org ([173.164.175.65]:40894 helo=Ishtar.sc.tlinx.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQhOR-0006nB-I0 for 25388@debbugs.gnu.org; Mon, 09 Jan 2017 16:22:16 -0500 Received: from [192.168.3.12] (Athenae [192.168.3.12]) by Ishtar.sc.tlinx.org (8.14.7/8.14.4/SuSE Linux 0.8) with ESMTP id v09LM9LH038234; Mon, 9 Jan 2017 13:22:11 -0800 Message-ID: <5873FF01.9010105@tlinx.org> Date: Mon, 09 Jan 2017 13:22:09 -0800 From: L A Walsh User-Agent: Thunderbird MIME-Version: 1.0 To: Eric Blake Subject: Re: bug#25388: Bug in ls, kills existing scripts reading "ls" -1 as input References: <587065F6.4040504@tlinx.org> <58731DF0.7030609@tlinx.org> <5873DB07.8090007@tlinx.org> <5873E6B5.4000807@tlinx.org> <5873EBED.2030800@tlinx.org> <5873F422.1060708@tlinx.org> <123ca499-ac24-74b6-744a-11e38e50dafe@redhat.com> In-Reply-To: <123ca499-ac24-74b6-744a-11e38e50dafe@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -3.2 (---) X-Debbugs-Envelope-To: 25388 Cc: Paul Eggert , Andreas Schwab , 25388@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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.2 (---) Eric Blake wrote: > On 01/09/2017 02:35 PM, L A Walsh wrote: >> I also stand for it being strongly against GNU >> standards to add more such behaviors. > > 'ls' did not recently add any more cases where tty output differs from > non-tty output when all other things are equal in the default state. > All that changed was that tty output is formatted differently than it > has been in the past. ---- That is not the case. Created dir with common files w/spaces in them from people's Doc dirs. I also replaced the space in "My Pictures w/a tab to see the effect -- though it wasn't necessary. > ls All Settings My Pictures Show Desktop.scf browser - logitech Bluetooth Software My Documents Start Menu Local Settings Saved Games Virtual Machines Then I did ls the standard way: All Settings Bluetooth Software Local Settings My Pictures My Documents Saved Games Show Desktop.scf Start Menu Virtual Machines browser - logitech === And quoted way: 'All Settings' 'Bluetooth Software' 'Local Settings' 'My'$'\t''Pictures' 'My Documents' 'Saved Games' 'Show Desktop.scf' 'Start Menu' 'Virtual Machines' 'browser - logitech' I cut & pasted into bash, and read them into array vars using readarray -t std and the same for the quoted version but to "readarray -t quoted". Now I look for the files 1 at a time in a loop: First old way (using -gG to shorten line): -rw-rw-r-- 1 0 Jan 9 13:06 All Settings -rw-rw-r-- 1 0 Jan 9 13:06 Bluetooth Software -rw-rw-r-- 1 0 Jan 9 13:06 Local Settings -rw-rw-r-- 1 0 Jan 9 13:06 My Pictures -rw-rw-r-- 1 0 Jan 9 13:06 My Documents -rw-rw-r-- 1 0 Jan 9 13:06 Saved Games -rw-rw-r-- 1 0 Jan 9 13:06 Show Desktop.scf -rw-rw-r-- 1 0 Jan 9 13:06 Start Menu -rw-rw-r-- 1 0 Jan 9 13:06 Virtual Machines -rw-rw-r-- 1 0 Jan 9 13:06 browser - logitech --- And now the new way that you claim is "the same output": ls: cannot access 'All Settings': No such file or directory ls: cannot access 'Bluetooth Software': No such file or directory ls: cannot access 'Local Settings': No such file or directory ls: cannot access 'My'$'t''Pictures': No such file or directory ls: cannot access 'My Documents': No such file or directory ls: cannot access 'Saved Games': No such file or directory ls: cannot access 'Show Desktop.scf': No such file or directory ls: cannot access 'Start Menu': No such file or directory ls: cannot access 'Virtual Machines': No such file or directory ls: cannot access 'browser - logitech': No such file or directory > your claim that ls' behavior is non-standard has been proven to be > false; I quoted the line from POSIX that explicitly permits ls --- By permitting it as an exception, you are admitting it is non-standard compared to other programs. > implementation-defined behavior when outputting to a terminal, and if it > is permitted by the standard, then the behavior can't be considered > non-standard. It may not be what you want, but that does not make it > non-standard. --- > Now you are excluding a fact. POSIX _does_ state that the output of > 'ls' when targetting a tty is implementation-defined, --- I'm not quoting posix -- I'm quoting the GNU standards you mention. Anyway, as demonstrated above, the output is not the same and varies based on whether or not the destination is a tty. Your claim that the output is the same is demonstrably false. They are not functionally equivalent. From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 09 16:23:57 2017 Received: (at 25388) by debbugs.gnu.org; 9 Jan 2017 21:23:57 +0000 Received: from localhost ([127.0.0.1]:48144 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQhQ5-0006qB-Kw for submit@debbugs.gnu.org; Mon, 09 Jan 2017 16:23:57 -0500 Received: from ishtar.tlinx.org ([173.164.175.65]:40934 helo=Ishtar.sc.tlinx.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQhQ4-0006q4-9q for 25388@debbugs.gnu.org; Mon, 09 Jan 2017 16:23:56 -0500 Received: from [192.168.3.12] (Athenae [192.168.3.12]) by Ishtar.sc.tlinx.org (8.14.7/8.14.4/SuSE Linux 0.8) with ESMTP id v09LNqQY038254; Mon, 9 Jan 2017 13:23:54 -0800 Message-ID: <5873FF68.9090307@tlinx.org> Date: Mon, 09 Jan 2017 13:23:52 -0800 From: L A Walsh User-Agent: Thunderbird MIME-Version: 1.0 To: Eric Blake Subject: Re: bug#25388: Bug in ls, kills existing scripts reading "ls" -1 as input References: <587065F6.4040504@tlinx.org> <58731DF0.7030609@tlinx.org> <5873DDC4.3070403@tlinx.org> <5873EA28.9090905@tlinx.org> <9801e979-38af-0eb8-d8af-e8048e23835e@redhat.com> In-Reply-To: <9801e979-38af-0eb8-d8af-e8048e23835e@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -3.2 (---) X-Debbugs-Envelope-To: 25388 Cc: Paul Eggert , Andreas Schwab , 25388@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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.2 (---) Eric Blake wrote: > On 01/09/2017 01:53 PM, L A Walsh wrote: >>> And POSIX merely codified existing practice (this is nothing new - it >>> has been this way since the 70's) >> --- >> Not anymore. >> >> Breaking "rm -fr ." wasn't an existing practice except >> at BSD-using dists (like BSD & SunOS). While Solaris was SysV, since it >> was bought up, it has changed. > > Please quit trying to change the topic. --- You said that posix codified existing practice and that it has been this way since the 70's. This is not true. You are making overly broad statements, or, more likely, using indeterminant pronouns. From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 09 16:53:29 2017 Received: (at 25388) by debbugs.gnu.org; 9 Jan 2017 21:53:29 +0000 Received: from localhost ([127.0.0.1]:48192 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQhsf-0007aJ-JA for submit@debbugs.gnu.org; Mon, 09 Jan 2017 16:53:29 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48408) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQhsd-0007a8-Qc for 25388@debbugs.gnu.org; Mon, 09 Jan 2017 16:53:28 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C96ED7EAB9; Mon, 9 Jan 2017 21:53:22 +0000 (UTC) Received: from [10.10.118.201] (ovpn-118-201.rdu2.redhat.com [10.10.118.201]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v09LrLL4023003; Mon, 9 Jan 2017 16:53:21 -0500 Subject: Re: bug#25388: Bug in ls, kills existing scripts reading "ls" -1 as input To: L A Walsh References: <587065F6.4040504@tlinx.org> <58731DF0.7030609@tlinx.org> <5873DDC4.3070403@tlinx.org> <5873EA28.9090905@tlinx.org> <9801e979-38af-0eb8-d8af-e8048e23835e@redhat.com> <5873FF68.9090307@tlinx.org> From: Eric Blake Openpgp: url=http://people.redhat.com/eblake/eblake.gpg Organization: Red Hat, Inc. Message-ID: <8cd44101-ecc9-f5f5-f928-0f5bf25645fb@redhat.com> Date: Mon, 9 Jan 2017 15:53:20 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <5873FF68.9090307@tlinx.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="PvXRDcfAmRKK74vjwISwcab5Mf5IRwSlQ" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 09 Jan 2017 21:53:22 +0000 (UTC) X-Spam-Score: -8.2 (--------) X-Debbugs-Envelope-To: 25388 Cc: Paul Eggert , Andreas Schwab , 25388@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -8.2 (--------) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --PvXRDcfAmRKK74vjwISwcab5Mf5IRwSlQ Content-Type: multipart/mixed; boundary="b6Bk3As6OLcC4f1lqdUqWwAJJnqPc4QgU"; protected-headers="v1" From: Eric Blake To: L A Walsh Cc: Paul Eggert , Andreas Schwab , 25388@debbugs.gnu.org Message-ID: <8cd44101-ecc9-f5f5-f928-0f5bf25645fb@redhat.com> Subject: Re: bug#25388: Bug in ls, kills existing scripts reading "ls" -1 as input References: <587065F6.4040504@tlinx.org> <58731DF0.7030609@tlinx.org> <5873DDC4.3070403@tlinx.org> <5873EA28.9090905@tlinx.org> <9801e979-38af-0eb8-d8af-e8048e23835e@redhat.com> <5873FF68.9090307@tlinx.org> In-Reply-To: <5873FF68.9090307@tlinx.org> --b6Bk3As6OLcC4f1lqdUqWwAJJnqPc4QgU Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 01/09/2017 03:23 PM, L A Walsh wrote: >=20 >=20 > Eric Blake wrote: >> On 01/09/2017 01:53 PM, L A Walsh wrote: >>>> And POSIX merely codified existing practice (this is nothing new - i= t >>>> has been this way since the 70's) >>> --- >>> Not anymore. >>> >>> Breaking "rm -fr ." wasn't an existing practice except >>> at BSD-using dists (like BSD & SunOS). While Solaris was SysV, since= it >>> was bought up, it has changed. >> >> Please quit trying to change the topic. > --- > You said that posix codified existing practice and that it has been > this way since the 70's. This is not true. You're quoting me out of context. When coupled with the sentences prior to what got quoted in this email, I was trying to emphasize only that that POSIX codified the existing practice of ls outputting different data to a tty than to a non-tty, and that the behavior of different ls output to a tty has been around since the 70s, which explains why POSIX codified that particular aspect of ls as standard-conforming behavior. By eliding the context, you are then attempting to broaden my statement into me making a blanket claim that POSIX can only ever codify existing practice (which may are may not be the case, but it was not the point I was trying to make), by twisting my claim into something unrelated to ls and dragging rm into the mix. >=20 > You are making overly broad statements, or, more likely, using > indeterminant pronouns. That was not my intent. Email is a lousy medium for communications. Here's the full context, for reference: >>> >>> Sure it is. 'ls' has done that since then 1980s. 'ls' shows >>> multicolumn output when the output is a tty, and single-column output= >>> when piped into a pager. >> ---- >> That would be really annoying if it were true. It doesn't do that >> on any of my *nix terms. When I put it through a pager I want it to p= age >> the output I just saw. That's what it's for. > > But that's EXACTLY what POSIX has specified, because it has been > existing practice for YEARS. So in my sentence, as originally written, the pronoun of "that's EXACTLY" is referring only to the earlier wording "'ls' has done that since then 1980s", and not a sweeping generalization to all of POSIX. And in my other sentence: >>>> And POSIX merely codified existing practice (this is nothing new - i= t >>>> has been this way since the 70's) the "it" is referring, again, to the behavior of 'ls' outputting something different for ttys. That is, read it as "(this is nothing new - ls having different tty output has been this way since the 70's)", and NOT as "(this is nothing new - POSIX has been codifying existing practice in this way since the 70's)" - particularly since POSIX did not exist in the 70's and therefore could not have been codifying existing practice for a duration of time that long. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --b6Bk3As6OLcC4f1lqdUqWwAJJnqPc4QgU-- --PvXRDcfAmRKK74vjwISwcab5Mf5IRwSlQ 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/ iQEcBAEBCAAGBQJYdAZQAAoJEKeha0olJ0Nql30H/3K096W8Xw1LSBNR+oIaZRM5 sp9b4HXNjeNVvf7F1XXcW+PtilJSzhNIxoOaL0PbfkZLJlCFK5wvyLY4sn0nrDaz GBa8oSMogM39Ea4JTHekuXDz2ncxculdcRnvNpOhzLGgkHG05K2B1mdIbn2cLQWu bNCAHmF+aOPdf3ZpG/CgV+hU9EjejnAN2BQRLsFvgVGTg84cTGel5zM7X0plAere oR4MFt0scSQ8k+tV37SEYet5JVCky5RRTDkyxL2QMFdgjzpCG5yGMdrUcMzrMex7 Mo5RaMB+myIArMlbhwxN5KKEdBUuG1/1cTEwFjrckwdGi9VkSB8KJ/s8Hyrhyrg= =3fC/ -----END PGP SIGNATURE----- --PvXRDcfAmRKK74vjwISwcab5Mf5IRwSlQ-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 09 17:53:18 2017 Received: (at 25388) by debbugs.gnu.org; 9 Jan 2017 22:53:18 +0000 Received: from localhost ([127.0.0.1]:48245 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQioY-0002Lo-6B for submit@debbugs.gnu.org; Mon, 09 Jan 2017 17:53:18 -0500 Received: from ishtar.tlinx.org ([173.164.175.65]:46822 helo=Ishtar.sc.tlinx.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQioW-0002Lg-IL for 25388@debbugs.gnu.org; Mon, 09 Jan 2017 17:53:16 -0500 Received: from [192.168.3.12] (Athenae [192.168.3.12]) by Ishtar.sc.tlinx.org (8.14.7/8.14.4/SuSE Linux 0.8) with ESMTP id v09MrACA048156; Mon, 9 Jan 2017 14:53:12 -0800 Message-ID: <58741456.2020707@tlinx.org> Date: Mon, 09 Jan 2017 14:53:10 -0800 From: L A Walsh User-Agent: Thunderbird MIME-Version: 1.0 To: Eric Blake Subject: Re: bug#25388: Bug in ls, kills existing scripts reading "ls" -1 as input References: <587065F6.4040504@tlinx.org> <58731DF0.7030609@tlinx.org> <5873DDC4.3070403@tlinx.org> <5873EA28.9090905@tlinx.org> <9801e979-38af-0eb8-d8af-e8048e23835e@redhat.com> <5873FF68.9090307@tlinx.org> <8cd44101-ecc9-f5f5-f928-0f5bf25645fb@redhat.com> In-Reply-To: <8cd44101-ecc9-f5f5-f928-0f5bf25645fb@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -3.2 (---) X-Debbugs-Envelope-To: 25388 Cc: Paul Eggert , Andreas Schwab , 25388@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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.2 (---) Eric Blake wrote: > You're quoting me out of context. Your context was not clear. > > When coupled with the sentences ---- Your "But" started that sentence responding to my statement. While you may have thought you included all previous context, it was interwoven with my statements, so the context was muddied. >> You are making overly broad statements, or, more likely, using >> indeterminant pronouns. > > That was not my intent. Email is a lousy medium for communications. --- That was how I took it, especially since in other areas posix has had no problem being more than descriptive. As soon as you claimed I was dragging in unrelated items, I figured out what you had meant. But the thing about posix only describing -- which was their original mission statement, to becoming a prescriptive body, is more than a bit of a sore spot, especially since one or more BSDer's have gone off on me in the past about how BSD won the standards war against SysV, since now the BSD'ers were able to be a majority in posix and change the standards to along BSD lines vs. SysV lines. That made me realize what a waste of energy was going to go into making bunches of tools incompatible with how they have been. ...And it progresses... I liked BSD, but now I see its followers as more than a bit religious, and unwilling to see anyone else's view. It's probably no coincidence that Apple chose a BSD-system as their base. As for email being a lousy medium... yeah, it's not the best, but not the worst. You went off on me because you thought I was changing ls's historical behavior, when my issue is compounding those incompatibilities by adding flaky features that can't be cut/pasted into anything. It's a poor option to do by default. From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 09 17:57:33 2017 Received: (at 25388) by debbugs.gnu.org; 9 Jan 2017 22:57:33 +0000 Received: from localhost ([127.0.0.1]:48263 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQisf-0002Sm-5N for submit@debbugs.gnu.org; Mon, 09 Jan 2017 17:57:33 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37146) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQisc-0002SV-1i for 25388@debbugs.gnu.org; Mon, 09 Jan 2017 17:57:30 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E33C661B8A; Mon, 9 Jan 2017 22:57:24 +0000 (UTC) Received: from [10.10.118.201] (ovpn-118-201.rdu2.redhat.com [10.10.118.201]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v09MvNbH031674; Mon, 9 Jan 2017 17:57:24 -0500 Subject: Re: bug#25388: Bug in ls, kills existing scripts reading "ls" -1 as input To: L A Walsh References: <587065F6.4040504@tlinx.org> <58731DF0.7030609@tlinx.org> <5873DB07.8090007@tlinx.org> <5873E6B5.4000807@tlinx.org> <5873EBED.2030800@tlinx.org> <5873F422.1060708@tlinx.org> <123ca499-ac24-74b6-744a-11e38e50dafe@redhat.com> <5873FF01.9010105@tlinx.org> From: Eric Blake Openpgp: url=http://people.redhat.com/eblake/eblake.gpg Organization: Red Hat, Inc. Message-ID: Date: Mon, 9 Jan 2017 16:57:22 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <5873FF01.9010105@tlinx.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="DHbFpQO2U7e6nrTe7Rk8JO8TMqiGreRH9" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 09 Jan 2017 22:57:25 +0000 (UTC) X-Spam-Score: -8.2 (--------) X-Debbugs-Envelope-To: 25388 Cc: Paul Eggert , Andreas Schwab , 25388@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -8.2 (--------) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --DHbFpQO2U7e6nrTe7Rk8JO8TMqiGreRH9 Content-Type: multipart/mixed; boundary="gI2g3iftWqo4RacFWoUbB2OLE4Aa1mj35"; protected-headers="v1" From: Eric Blake To: L A Walsh Cc: Paul Eggert , Andreas Schwab , 25388@debbugs.gnu.org Message-ID: Subject: Re: bug#25388: Bug in ls, kills existing scripts reading "ls" -1 as input References: <587065F6.4040504@tlinx.org> <58731DF0.7030609@tlinx.org> <5873DB07.8090007@tlinx.org> <5873E6B5.4000807@tlinx.org> <5873EBED.2030800@tlinx.org> <5873F422.1060708@tlinx.org> <123ca499-ac24-74b6-744a-11e38e50dafe@redhat.com> <5873FF01.9010105@tlinx.org> In-Reply-To: <5873FF01.9010105@tlinx.org> --gI2g3iftWqo4RacFWoUbB2OLE4Aa1mj35 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 01/09/2017 03:22 PM, L A Walsh wrote: >=20 >=20 > Eric Blake wrote: >> On 01/09/2017 02:35 PM, L A Walsh wrote: >>> I also stand for it being strongly against GNU >>> standards to add more such behaviors. >> >> 'ls' did not recently add any more cases where tty output differs from= >> non-tty output when all other things are equal in the default state. >> All that changed was that tty output is formatted differently than it >> has been in the past.=20 > ---- > That is not the case. >=20 > Created dir with common files w/spaces in them from people's > Doc dirs. I also replaced the space in "My Pictures w/a tab to > see the effect -- though it wasn't necessary. Okay, I'm going to follow along, using two different versions of ls: 8.25 (Fedora 25) and 8.4 (RHEL 6). $ mkdir -p /tmp/ls $ cd /tmp/ls $ touch 'a b' c Now, let's check whether output differed based on tty in the old version, 8.4: $ \ls a b c $ \ls | cat a b c $ \ls -1 | cat a b c $ \ls --version | head -n1 ls (GNU coreutils) 8.4 Yep, the output is different based on whether stdout was a tty. Now, let's check again with a modern version: $ \ls 'a b' c $ \ls | cat a b c $ \ls -1 | cat a b c $ \ls --version | head -n1 ls (GNU coreutils) 8.25 Yep, the output STILL differs based on whether stdout was a tty. But note, that in BOTH cases, the output of '\ls -1' is identical when stdout is NOT a tty. If you are parsing the output of ls -1 in a script, chances are you are NOT creating a pty, and therefore the output you are parsing did NOT change. The only content that changed between ls versions is the CONTENT of the tty output, but NOT the logic of whether to use tty output, nor the content when tty output is not involve= d. The GNU Coding Standards do NOT forbid the content of tty output to change between versions (that is, the tty output of version x.1 and x.2 need not be the same), they only state that if version x.1 outputs a particular text to a non-tty, it should default to outputting that same text to a tty, IF that difference in behavior was not already grandfathered in. Let's go read the actual GNU Coding Standards, instead of paraphrasing it= : https://www.gnu.org/prep/standards/standards.html#User-Interfaces "Likewise, please don=E2=80=99t make the behavior of a command-line progr= am depend on the type of output device it gets as standard output or standard input. Device independence is an important principle of the system=E2=80=99s design; do not compromise it merely to save someone from= typing an option now and then. (Variation in error message syntax when using a terminal is ok, because that is a side issue that people do not depend on= =2E) If you think one behavior is most useful when the output is to a terminal, and another is most useful when the output is a file or a pipe, then it is usually best to make the default behavior the one that is useful with output to a terminal, and have an option for the other behavior. You can also build two different versions of the program with different names. There is an exception for programs whose output in certain cases is binary data. Sending such output to a terminal is useless and can cause trouble. If such a program normally sends its output to stdout, it should detect, in these cases, when the output is a terminal and give an error message instead. The -f option should override this exception, thus permitting the output to go to the terminal. Compatibility requires certain programs to depend on the type of output device. It would be disastrous if ls or sh did not do so in the way all users expect. In some of these cases, we supplement the program with a preferred alternate version that does not depend on the output device type. For example, we provide a dir program much like ls except that its default output format is always multi-column format." Nothing in there says that we can't change what ls outputs to a termianl between versions of ls, merely that the reason that ls DEFAULTS to different output to terminal than to non-terminal is historical. Furthermore, it _encourages_ output to a terminal to default to being safe in the presence of binary data (filenames can contain control characters, which if not properly quoted are indeed disastrous to the terminal), and does not forbid us from using a version of quoting that is less ambiguous in newer versions of ls than it was in previous version= s. >> your claim that ls' behavior is non-standard has been proven to be >> false; I quoted the line from POSIX that explicitly permits ls > --- > By permitting it as an exception, you are admitting it > is non-standard compared to other programs. Huh? The fact that ls is allowed to have implementation-defined output when writing to a tty is standard. It may not be consistent with other applications, but the point being discussed here wasn't consistency, but standards-compliant. You can't be non-standard by comparing to another app - either the behavior of ls is permitted by the standard or it is not permitted, regardless of what other apps do. > =20 >> Now you are excluding a fact. POSIX _does_ state that the output of >> 'ls' when targetting a tty is implementation-defined, > --- > I'm not quoting posix -- I'm quoting the GNU > standards you mention. I actually quoted it above. So far, you have only paraphrased it, and I think you are trying to claim that the GNU Coding Standards do not let us change the tty-only output between versions, but that is not what it says. >=20 >=20 > Anyway, as demonstrated above, the output is not the same and > varies based on whether or not the destination is a tty. Indeed - and we've been telling you that default ls output has ALWAYS varied based on whether or not the destination is a tty. The fact that it STILL varies (although with different content than in older versions of ls) is nothing new. We are not violating the requirement that no NEW code should have a difference based on tty, because we already HAVE a difference based on tty. >=20 > Your claim that the output is the same is demonstrably false. No, you have only managed to prove that the tty-only output of ls has changed between versions, and NOT that the tty-only and non-tty output used to be the same but now differ. The tty-only and non-tty output have ALWAYS been different, and I was not claiming that they have been the same. > They are not functionally equivalent. You are trying to feed tty output into a shell script. In general, this is not portable. But this is not ls' fault. It has NEVER been portable to try and parse the tty-only output of ls in a shell script. Just because the outcome of trying to parse non-portable output has changed doesn't mean that the output is broken - rather, your attempt to feed non-portable output to the shell in the first place is broken. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --gI2g3iftWqo4RacFWoUbB2OLE4Aa1mj35-- --DHbFpQO2U7e6nrTe7Rk8JO8TMqiGreRH9 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/ iQEcBAEBCAAGBQJYdBVSAAoJEKeha0olJ0NqfxAH/iIwUFfglTmSoNpbOxmS1jJV soXIJKCPfXzQDv+INob8Qp5MuJVH1r/D/TOdA0VidWWp3lVknunjDYdrhhfSw98a 5bfeftX2p+I5NoREq0M6K6n8iP9ZJLxbEgwxbDgaRvcdUOkkVvB+fCWEG4JBsjJT jsRReolCJMfqpD8S0g3XtA/gCaUQwfA3f92oYCcpDjiZDKuqOGStm3haHMvn1sAJ u+nmtB2tNm1pI/oyKam3oyWzvOPugAUrKwUX+X2zt30/D3Bcd/cxB56GeBhVtdi1 xxuciuEtVaGZaFEGiwnNwt++Oh6K4Y9oHI6K1UDXN1hlSBqMfheaRRPQrjzj0RE= =zPje -----END PGP SIGNATURE----- --DHbFpQO2U7e6nrTe7Rk8JO8TMqiGreRH9-- From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 28 03:49:35 2018 Received: (at control) by debbugs.gnu.org; 28 Oct 2018 07:49:35 +0000 Received: from localhost ([127.0.0.1]:46514 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gGfpH-0000Hr-0n for submit@debbugs.gnu.org; Sun, 28 Oct 2018 03:49:35 -0400 Received: from mail-it1-f177.google.com ([209.85.166.177]:40323) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gGfpF-0000Hf-AJ for control@debbugs.gnu.org; Sun, 28 Oct 2018 03:49:33 -0400 Received: by mail-it1-f177.google.com with SMTP id i191-v6so6175476iti.5 for ; Sun, 28 Oct 2018 00:49:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:message-id:date:user-agent:mime-version:content-language :content-transfer-encoding; bh=JZQYLQ93meNmTFsh5A57eZcTxrLCycYvjVcTTc+eZok=; b=ggVyQ2JGQZ0y4i1Jbbgy3weoqT+D58J/Jcwm6D3ORioVsgPYohuCknLxyMKyVlkFo7 AQDFrb3EcvYac2Pek0uJa4xnbU+PFDJ4HIqtie7on2EWrYKOVqN47jiNMkaV7kNJppqJ Y/FLEoHocJPGa4ha1rvR8MQu5rCU9jmea/RHV1BggidyWUyHmcRRbaGMSHoE0Of3/tID BsWxCpzQnfnWXbc/Y2Ae+JpoE5aKu4TCCGoDqrKQA4Ps/HYgY2XbD+5HLbd+sC1oTcDq VlOYbkU9N9Ics77LS640ciS0Fa/AccfkQjXjInJ5jFrwuL6PTBWdpEILsbZBzhCiS8Ka BSbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=JZQYLQ93meNmTFsh5A57eZcTxrLCycYvjVcTTc+eZok=; b=B8QxX4bEcYuxBCKm6BmXQSBqdRstRTGvn/jmnc05FyYM2P9N6JU61A+Xro4nFHkg1n jftWSM1FB2gythcxu42L7DXEIgrnUxLbCngoXdUIbMZxwuFsg7pweRhJct9DAYjj8q95 /Gby/zfSXCWW0VVVjKPRLvyOL2GMUa8rddyWE6PqLPgbBImt5gR6Fa9RlfRPaOHLtAg6 tfXK0VH+wEiUFfguKMoHW5ZfyQdyylnZISn3/dWQmG3OTxsbqwrjCyI0eVJ/MUpmxCkH +2gJTipIiOGxrFLrl5n5I9ZPfFfjM4VDjZPnygqkbxh+sTsjWU/5zQ6jtuyxs6JQOZE0 jYqA== X-Gm-Message-State: AGRZ1gJ2OErQ6TrOAbODPquGGRNEwcypHp1A5D6j6ln2E5l2CcgHQK8b q/4IPEzyAnr6r0NEVetuI3KcaMVald4= X-Google-Smtp-Source: AJdET5dC3ojQZ3k9Ws3MYKmlToD93rPfbNYhK7PL/CGOr4WukzcJ7opNomVz8Fbk8GHlxf5LGmvRHw== X-Received: by 2002:a24:5a8b:: with SMTP id v133-v6mr6573607ita.133.1540712967292; Sun, 28 Oct 2018 00:49:27 -0700 (PDT) Received: from tomato.housegordon.com (moose.housegordon.com. [184.68.105.38]) by smtp.googlemail.com with ESMTPSA id n202-v6sm19399itn.34.2018.10.28.00.49.25 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Oct 2018 00:49:26 -0700 (PDT) To: control@debbugs.gnu.org From: Assaf Gordon Message-ID: <5ee1561d-3c43-86a3-0bd4-a685842f680b@gmail.com> Date: Sun, 28 Oct 2018 01:49:24 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: retitle 25388 ls-quotes: kills existing scripts reading "ls" -1 as input [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (assafgordon[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.166.177 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [209.85.166.177 listed in list.dnswl.org] 1.8 MISSING_SUBJECT Missing Subject: header 0.2 NO_SUBJECT Extra score for no subject X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: 1.0 (+) retitle 25388 ls-quotes: kills existing scripts reading "ls" -1 as input From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 13 15:29:21 2018 Received: (at 25388-done) by debbugs.gnu.org; 13 Dec 2018 20:29:21 +0000 Received: from localhost ([127.0.0.1]:46844 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gXXbl-0000jT-1L for submit@debbugs.gnu.org; Thu, 13 Dec 2018 15:29:21 -0500 Received: from mail-pl1-f172.google.com ([209.85.214.172]:43200) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gXXbj-0000jF-2n for 25388-done@debbugs.gnu.org; Thu, 13 Dec 2018 15:29:19 -0500 Received: by mail-pl1-f172.google.com with SMTP id gn14so1580113plb.10 for <25388-done@debbugs.gnu.org>; Thu, 13 Dec 2018 12:29:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=xhnI6xpEfWO4fexv9Rowi3foN1Kf+fm3+GE92pjA/Rs=; b=AQCwRIhCBqgp5Av3F0U9kvtdKRB1Aoy4VQhM/VaRXm24RIrKmnHWa2SC92plFSZayf ME+dYYNQkj/rRDys6R87+AjrEeKrjtr2QNFk56OpuWOzHoiSIVQOwjSn/HnVoOzhlwRo bUINhBVFcNRYqbEVxDIp/hy8XgMBfROcl+m7Yi7yr7r9FQwSYpHuzHkm9vn2ipjOXur5 z9A2yzEY3etEaQyQguyd79wLyJhW/8WFtM2TrTWTif/eagx6OLP/eCAq+ATDgYmFHfpn nPhof1wnQGVZ5YWqbq6WuQTE4t30fpxVs00KrNVOszYNe+vtSlrwivAvQrWdyGbVhnUC 8xpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=xhnI6xpEfWO4fexv9Rowi3foN1Kf+fm3+GE92pjA/Rs=; b=RXwLcKFEW+hvXUgWfvgcT740ytTgMHp77KTFqHSPLfp/VreGf++nXC2lGqSARFrCLI rJ8/E/lAWJ/ENIILMVvV6cDXsrhIpIBV1vxwqjiT6iKhfaRsxRy1v8VFna167RAKhMkY Rl4SjFGPEXkjTwNnWNiAS3KGEakKhoEMmtTHfkA2J3U2Df/nG1+FxjuT9W2FbMjHSEjL eC+X3gAa7sW6Y0KvtapwCWHbFMwMotJppVLs+ItNKp1UlcwzxzFtp701oB9yluUFyEge zuk3rltNLeOa1/qnUYFJN483eg5IpJtkr+BDF4kxjnvh82nCcoivt/+tpjcH60vGbSH9 SpgQ== X-Gm-Message-State: AA+aEWZzhbBJ+ze71F76+DbAI9PTucqmHSviUNpVzHDpr4NguRFT3GDp 5WMYxG13bDGfRcng15NzsETLdl+aSfY= X-Google-Smtp-Source: AFSGD/VeRLEVI9SZoi64m4LCgjgTE9gbaJ6R2dpZXt5UoSk5ttP/eaE32AfEweb80rqShssgrlJ5Fw== X-Received: by 2002:a17:902:e290:: with SMTP id cf16mr250865plb.81.1544732952698; Thu, 13 Dec 2018 12:29:12 -0800 (PST) Received: from tomato.housegordon.com (moose.housegordon.com. [184.68.105.38]) by smtp.googlemail.com with ESMTPSA id y12sm6561045pfk.70.2018.12.13.12.29.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Dec 2018 12:29:11 -0800 (PST) Subject: Re: bug#25388: Bug in ls, kills existing scripts reading "ls" -1 as input To: L A Walsh References: <587065F6.4040504@tlinx.org> <58731DF0.7030609@tlinx.org> <5873DB07.8090007@tlinx.org> <5873E6B5.4000807@tlinx.org> <5873EBED.2030800@tlinx.org> <5873F422.1060708@tlinx.org> <123ca499-ac24-74b6-744a-11e38e50dafe@redhat.com> <5873FF01.9010105@tlinx.org> From: Assaf Gordon Message-ID: <5ab7cb60-2cda-ce54-215e-0c5b67de7e67@gmail.com> Date: Thu, 13 Dec 2018 13:29:08 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 25388-done Cc: Andreas Schwab , 25388-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -1.0 (-) Hello, >>> 'ls' did not recently add any more cases where tty output differs from >>> non-tty output when all other things are equal in the default state. >>> All that changed was that tty output is formatted differently than it >>> has been in the past. >> ---- We created a summary of common issues and FAQs regarding the quoting change in ls(1): https://www.gnu.org/software/coreutils/quotes.html If there is an issue that is not addressed there, please send an email to coreutils@gnu.org . regards, - assaf From unknown Fri Jun 20 07:09:15 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 11 Jan 2019 12:24:10 +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