【发布时间】:2022-11-03 06:39:51
【问题描述】:
我在 bash 脚本中有以下命令。
GREP_RESULT=$(grep -zoP "\.global LIST(.|\n)*-1\Z" part1.s)
我收到以下错误。
warning: command substitution: ignored null byte in input
我已经尝试了this 帖子中提出的解决方案,将其更改为以下内容。
GREP_RESULT=$(tr -d '\0' < grep -zoP "\.global LIST(.|\n)*-1\Z" part1.s)
这反过来导致以下错误。
grep: No such file or directory
解决第一个错误的正确方法是什么?
【问题讨论】: