[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: using NUL in scripts
From: |
Eric Blake |
Subject: |
Re: using NUL in scripts |
Date: |
Wed, 26 Sep 2007 19:42:52 -0600 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070728 Thunderbird/2.0.0.6 Mnenhy/0.7.5.666 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Mike Frysinger on 9/26/2007 7:04 PM:
> is it even possible to utilize NUL in scripts ? or does bash just strip it
> out ? for example, trying to work with binary data:
> foo=$(<binary-file)
> echo "${foo}" > new-file
> the "new-file" will be exactly "binary-file" if all NUL bytes are stripped out
POSIX is silent on the matter. zsh preserves NUL in command substitution,
bash strips them out. Perhaps it is worth raising the issue with the
Austin group for clarification.
- --
Don't work too hard, make some time for fun as well!
Eric Blake ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFG+wqc84KuGfSFAYARAmD5AJ0RsaTyeXv/3UboG4OY3ndMCxVbvACdHiPA
HPg3MAqiAHcNAU9cZmeLmvk=
=r4Df
-----END PGP SIGNATURE-----