Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #12065

Re: count

Path csiph.com!xmission!news.glorb.com!usenet.stanford.edu!not-for-mail
From Greg Wooledge <wooledg@eeg.ccf.org>
Newsgroups gnu.bash.bug
Subject Re: count
Date Mon, 21 Dec 2015 09:31:00 -0500
Lines 16
Approved bug-bash@gnu.org
Message-ID <mailman.306.1450708267.843.bug-bash@gnu.org> (permalink)
References <1450487143595-16675.post@n7.nabble.com> <CAAJSdjhf=DC2cZVcecs5L_c2CwMQXFQBG_Gopqnbg+esJ9BTTQ@mail.gmail.com>
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
X-Trace usenet.stanford.edu 1450708267 27818 208.118.235.17 (21 Dec 2015 14:31:07 GMT)
X-Complaints-To action@cs.stanford.edu
Cc Krem <valkrem@yahoo.com>, "bug-bash@gnu.org" <Bug-bash@gnu.org>
To John McKown <john.archie.mckown@gmail.com>
Envelope-to bug-bash@gnu.org
Content-Disposition inline
In-Reply-To <CAAJSdjhf=DC2cZVcecs5L_c2CwMQXFQBG_Gopqnbg+esJ9BTTQ@mail.gmail.com>
User-Agent Mutt/1.4.2.3i
X-detected-operating-system by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From 139.137.100.1
X-BeenThere bug-bash@gnu.org
X-Mailman-Version 2.1.14
Precedence list
List-Id Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive <http://lists.gnu.org/archive/html/bug-bash>
List-Post <mailto:bug-bash@gnu.org>
List-Help <mailto:bug-bash-request@gnu.org?subject=help>
List-Subscribe <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
Xref csiph.com gnu.bash.bug:12065

Show key headers only | View raw


On Mon, Dec 21, 2015 at 08:21:04AM -0600, John McKown wrote:
> find . -maxdepth 2 -mindepth 2 -type f -name '*.csv' -o -name '*.txt' |\
> egrep '^\./[0-9]' |\
> xargs awk 'ENDFILE {print FILENAME "\t" FNR;}' |\
> sed -r 's|^./||;s|/|\t|'   |\
> xargs -L 1 echo -e "${PWD##*/}\t"???

> ???This is "more elegant" (in my mathematically twisted mind) than my
> previous solution.

No, it's not.

In addition to whatever quoting bugs may still exist, now you're involving
xargs, which has ITS OWN ENTIRELY NEW set of bugs, and breaks on any
filename that contains whitespace, single quotes, or double quotes.

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

Re: count Greg Wooledge <wooledg@eeg.ccf.org> - 2015-12-21 09:31 -0500

csiph-web