Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > gnu.bash.bug > #14255
| From | Clark Wang <dearvoid@gmail.com> |
|---|---|
| Newsgroups | gnu.bash.bug |
| Subject | Re: Variables can’t contain NUL |
| Date | 2018-06-20 23:36 +0800 |
| Message-ID | <mailman.2300.1529509015.1292.bug-bash@gnu.org> (permalink) |
| References | <564532BD.60801@tlinx.org> <20151113131735.GE27325@eeg.ccf.org> <e5ye6lts2mjn.ykx.xxuns.g6.gal_-_@galex-713.eu> <53b5d00cbfcaffbc9da712835682bc031d18b778.camel@scope-eye.net> |
On Wed, Jun 20, 2018 at 10:22 PM, George <tetsujin@scope-eye.net> wrote:
>
> Personally I do think some method of handling arbitrary binary data in the
> shell would be a welcome addition (and I think zsh provides that - don't
> remember if ksh does)
>
Ksh93 has "typeset -b" which defines vars for binary data (actually base64
encoded). E.g.:
[STEP 100] $ echo ${.sh.version}
Version AJM 93u+ 2012-08-01
[STEP 101] $ typeset -b var
[STEP 102] $ var=$( echo hello world | base64 )
[STEP 103] $ echo $var
aGVsbG8gd29ybGQK
[STEP 104] $ printf %B var
hello world
[STEP 105] $
Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread
Re: Variables can’t contain NUL Clark Wang <dearvoid@gmail.com> - 2018-06-20 23:36 +0800
csiph-web