bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: count


From: Greg Wooledge
Subject: Re: count
Date: Mon, 21 Dec 2015 09:31:00 -0500
User-agent: Mutt/1.4.2.3i

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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]