[wellylug] cat bug ?

Glen Ogilvie nelg at linuxsolutions.co.nz
Tue Mar 8 07:13:58 NZDT 2005


Hi,

I have also struck this, basically, it's the glob b00* is being expanded to a 
list of files longer than the limit for arguments.    You have 2 options to 
get around this.  Modify one of the kernel's header files, then recompile the 
kernel, as it's a static value that can be changed in the code, or, use the 
find command, somethine like the following at a guess. (untested).

rm ../space/c.raw
find . -name "b00*" -exec cat {} >> ../space/c.raw \;

Cheers
Glen Ogilvie

On Monday 07 March 2005 9:35 pm, Chris Harris wrote:
> Hi Folks
>
> I had 2,256  1,048,576 byte files that were supposed to be one 2.2G file
> so I naively typed:
>
> 	cat b00* > ../space/c.raw
>
> I was surprised to discover the output was only 1,048,576,000 bytes.
> I presume cat takes at most 1000 <= argc.
> It would have been nice if it had told me.
>
> I ended up making 3 files with:
>
>   for m in b00 b01 b02
>   do
>     for n in $m*
>     do
>       cat $n >> ../space/$m.raw
>     done
>   done
>
> After getting a corrupted file of the right size with:
>
>   for n in b0*
>   do
>     cat $n >> ../space/d.raw
>   done
>
> Anyone got the cat 5.2.1 source code open in front of them?
>
> C
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.wellylug.org.nz/pipermail/wellylug/attachments/20050308/9e98c819/attachment.pgp 


More information about the wellylug mailing list