bash limits ?
Peter L. Peres
plp-ysDPMY98cNQDDBjDh4tngg at public.gmane.org
Fri Sep 10 01:30:01 UTC 2004
On Thu, 9 Sep 2004, Lennart Sorensen wrote:
> 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.
I tried that using seq. The limit is much higher and if the other
responders are right, it should not be a problem.
>> 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%' | ...
Right, I haven't thought of that. Since I also need sorting I had an eye
on gawk.
Peter
--
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