help-bash
[Top][All Lists]
Advanced

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

Is there a way to not to ignore null in $()?


From: Peng Yu
Subject: Is there a way to not to ignore null in $()?
Date: Mon, 11 May 2020 07:13:54 -0500

$ x=$(awk -e 'BEGIN{print "a\000b" }')
-bash: warning: command substitution: ignored null byte in input
$ declare -p x
declare -- x="ab"

I think that there is no way to avoid the above warning as no null
character can be in a bash variable. But if I want to avoid using a
temp file, then I have to have to save the output in a bash variable?

Is there a good way to save some binary data in memory in bash? Thanks.

-- 
Regards,
Peng



reply via email to

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