bash limits ?

Lennart Sorensen lsorense-1wCw9BSqJbv44Nm34jS7GywD8/FfD2ys at public.gmane.org
Thu Sep 9 17:57:21 UTC 2004


On Thu, Sep 09, 2004 at 08:52:45PM -0400, Peter L. Peres wrote:
> The exact command I'm using is:
> 
> SORTED=$(find $TMPDIR/* -type f|grep -E [0-9]+|cut -d'/' -f4|sort)

That could expand to a long list of files I suspect.  Perhaps it is the
$(..) that has the limit you are encountering.

> where the argument of find should expand to no more than 100 entries (102 
> with . and ..). the entries are guaranteed unique so that's not a problem. 
> The cut -f4 matches several slashes which are in TMPDIR and leaves just 
> the [0-9]{8} filename part to sort. Unfortunately basename cannot be used 
> in a pipe (why did they write it like that ? - I should write a 
> replacement that can be used in a pipe !).

Because sed works well?

... | sed -e 's%.*/\([^/]*\)$%\1%' | ...

Lennart Sorensen
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list