bug-coreutils
[Top][All Lists]
Advanced

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

Re: nl command line option not recognized


From: Emmanuel Dumont
Subject: Re: nl command line option not recognized
Date: Mon, 16 Mar 2009 12:43:55 -0400
User-agent: Thunderbird 2.0.0.18 (X11/20081120)

Eric Blake wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

[re-adding the list, so that the archives see the resolution of this thread]
echo filename.*.* | xargs nl --starting-line-number=2

will proceed to chunk your listing into the fewest number of necessary
processes, although you will then have to deal with the fact that each
instance of nl starts its numbering over again.  And by using echo (a
shell builtin) instead of ls (an external process), you are using one less
process.  But that does not deal with newlines in the glob, so you may
want to use GNU findutils, and:

find -maxdepth 1 -name 'filename.*.*' -print0 \
 | xargs -0 nl --starting-line-number=2
you definitely need a pipe after the xargs cmd, otherwise a lot of binary garbage is output. But btw, that cmd does not do what I want (even with added pipe) since it lists all files (unsorted) on one line instead of one file per line.

/bin/ls  turntable_render.*.*   |  xargs -0  |  nl --starting-line-number=2

that one is fine

emmanuel





reply via email to

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