Date: Thu, 11 Nov 1999 19:12:47 -0600 From: Dan Nelson <dnelson@emsphone.com> To: Paul Eggert <eggert@twinsun.com> Cc: tstromberg@rtci.com, freebsd-current@FreeBSD.ORG, bug-gnu-utils@gnu.org Subject: Re: Bad 'grep' behaviour in -CURRENT, faulty binary detection? Message-ID: <19991111191247.A6353@dan.emsphone.com> In-Reply-To: <199911120028.QAA06638@shade.twinsun.com>; from eggert@twinsun.com on Thu, Nov 11, 1999 at 04:28:53PM -0800 References: <382B2711.E13A1CC8@rtci.com> <199911120028.QAA06638@shade.twinsun.com>
next in thread | previous in thread | raw e-mail | index | archive | help
In the last episode (Nov 11), Paul Eggert said:
> Most likely this is because the output of your `set' command contains
> binary data. In the past, this has been reported by people whose `set'
> command would output something like this:
>
> IFS='
> ^@'
>
> where the `^@' in my message denotes a single NUL byte (control-@) in
> the original. If this is what's happening to you, then this is quite
> possibly a bug in your shell, since environment variables cannot
> possibly contain NUL bytes in Unix.
Aah, but 'set' prints the value of all shell variables, exported or
not. You can store any value in a shell variable. In fact, I do things
like this quite often (/bin/sh example here - zsh can do the same
without forking to set a):
a=$(cat file.gif)
size=${#a}
echo Content-Length: $size
echo Content-Type: image/gif
echo
echo -n $a
I agree that _environment_ variables can't have NULs in them.
--
Dan Nelson
dnelson@emsphone.com
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19991111191247.A6353>
