[Top][All Lists]

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

Re: reading ascii-0

From: William Park
Subject: Re: reading ascii-0
Date: Tue, 8 Mar 2005 17:49:03 -0500
User-agent: Mutt/1.4.2i

On Tue, Mar 08, 2005 at 03:26:37PM -0600, Davy Durham wrote:
> Hey,
>  I was wondering if it's possible to make the build-in 'read' command 
> not always stop at ascii 0.
> I've got a file "foo" with "asdf\0qwer\n" in it and when I do:
>   read x < foo
> then
>   echo ${#x}
> always returns 4 instead of 9 or 10 because it stopped after "asdf" at 
> the null char
> I've played with setting $IFS, and with -r and -d on the read command 
> itself, but nothing seems to work.
> Is this possible?

    x=`< foo`

William Park <address@hidden>, Toronto, Canada
Slackware Linux -- because it works.

reply via email to

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