bug-gawk
[Top][All Lists]
Advanced

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

Re: [bug-gawk] regexp that cannot match anything


From: Andrew J. Schorr
Subject: Re: [bug-gawk] regexp that cannot match anything
Date: Mon, 21 Jan 2013 13:46:30 -0500
User-agent: Mutt/1.5.21 (2010-09-15)

On Mon, Jan 21, 2013 at 08:48:23AM +0200, Denis Shirokov wrote:
> I try to read using getline operator whole file as the single string.
...
> BINMODE="rw"; RS="\\x00{0}"
> getline d < "filename"

If you're able to use the gawk 4.1 prerelease, I recommend using
that with the readfile extension:

bash-4.1$ ls -l /etc/passwd
-r--r--r-- 1 root root 10475 Aug  2 11:30 /etc/passwd
bash-4.1$ gawk -l readfile -v filename=/etc/passwd 'BEGIN {d = 
readfile(filename); print length(d)}'
10475

Regards,
Andy



reply via email to

[Prev in Thread] Current Thread [Next in Thread]