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

Re: get number of pages of a PostScript file



On Sat, Apr 28, 2001 at 07:15:37PM -0300, John R Lenton wrote:
> > grep ^%%Pages file.ps|awk '{ print $2 }'
> 
> any idea why this is 2x as fast as the equivalent
>    awk '/^%%Pages/ { print $2 }' file.ps

Because grep, being a compiled program, can do file I/O faster than
awk, which is interpreted.

Walt

Attachment: pgpKwl5X2PY6Y.pgp
Description: PGP signature


Reply to: