gpt4 book ai didi

bash - 如何在 redis-cli 参数中使用控制字符?

转载 作者:IT王子 更新时间:2023-10-29 06:11:08 25 4
gpt4 key购买 nike

我想从我的 bash 脚本中执行什么:

redis-cli srem myset "abc\x06def"

\x06 部分似乎被忽略了。

操作系统是 Ubuntu 14.04 LTS 和 LANG=en_US.UTF-8,如果这些与问题有关。

最佳答案

我建议使用 bash:

redis-cli srem myset "abc"$'\x06'"def"

检查是否存在:

echo "abc"$'\x06'"def" | hexdump -C

输出:

00000000  61 62 63 06 64 65 66 0a                           |abc.def.|00000008

关于bash - 如何在 redis-cli 参数中使用控制字符?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40829008/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com