bash limits ?
Peter L. Peres
plp-ysDPMY98cNQDDBjDh4tngg at public.gmane.org
Fri Sep 10 01:36:26 UTC 2004
On Thu, 9 Sep 2004, William Park 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)
>>
>> 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 !).
>
> I don't see any problem area. Try each command in sequence, ie.
> find $TMPDIR/* -type f
> find $TMPDIR/* -type f|grep -E [0-9]+
> find $TMPDIR/* -type f|grep -E [0-9]+|cut -d'/' -f4
> find $TMPDIR/* -type f|grep -E [0-9]+|cut -d'/' -f4|sort
>
> You should put [0-9]+ in quotes like '[0-9]+'.
I tried that, using wc -w as last command. The problem is not there. It
must be something simple that is toatally obvious and happens only when
$SORTED is used with for ... I tried putting the entire pipeline as the
argument of for ... and that didi not fix it. I will look at it some more.
thanks,
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