bug-bash
[Top][All Lists]
Advanced

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

Re: Variables can’t contain NUL


From: Clark Wang
Subject: Re: Variables can’t contain NUL
Date: Wed, 20 Jun 2018 23:36:10 +0800

On Wed, Jun 20, 2018 at 10:22 PM, George <address@hidden> 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] $


reply via email to

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