help-bash
[Top][All Lists]
Advanced

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

How to read \000?


From: Peng Yu
Subject: How to read \000?
Date: Wed, 15 May 2024 14:21:41 -0500

Hi,

$ echo -ne '\000a' | { read -N 1 x; declare -p x ; }
declare -- x="a"

read just skip \000 and read the next char "a". What if I want to read
the underlying character, in this case, it is \000, then x should be
just an empty string.

Can this be achieved somehow in bash?

-- 
Regards,
Peng



reply via email to

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