bash - 摆脱“警告:命令替换:输入中忽略的空字节”
问题描述
我最近升级了 bash,现在打开新终端时出现此错误:
-bash: warning: command substitution: ignored null byte in input
这是我的 .bash_profile 中导致问题的行:
PS1="\[ $txtblu\w$txtgrn\$(branch)$txtwht ∴$txtrst \]"
NB Bash 版本
bash --version
GNU bash, version 5.0.0(1)-release (x86_64-apple-darwin18.2.0)
我需要更改哪些内容才能删除此警告?
变量:
txtrst='\[\e[0m\]' # Text Reset
txtblu='\[\e[0;34m\]' # Blue
txtgrn='\[\e[0;32m\]' # Green
txtwht='\[\e[0;37m\]' # White
txtred='\[\e[0;31m\]' # Red
解决方案
推荐阅读
- node.js - 使用 Vault 存储客户端 PEM 和 KEY 以供以后与 fetch 一起使用
- c# - 剃刀组件的 HtmlTargetElementAttribute 等效项?
- c++ - 如何修复:自定义 QGraphicsItem 接收 mousePressEvent 坐标延迟/滞后?
- mql5 - 盈亏平衡功能中的无效止损
- matlab - 在Matlab中使用for循环将矩阵划分为列数相等的小矩阵?
- go - 如何使用 gorm 解决“运行时错误:无效的内存地址或 nil 指针取消引用”
- python - 在 Python 中创建赛车,为什么我的车没有赛车?
- java - Java - Base64 解码
- r - 在 r 中绘制两个 sf POINT 特征之间的线
- c# - 如何使用 sqlite 数据库部署 C# WPF 应用程序?