Get rid of “warning: command substitution: ignored null byte in input”

前端 未结 2 1309
暗喜
暗喜 2021-01-01 15:08

I\'m getting -bash: warning: command substitution: ignored null byte in input when I run model=$(cat /proc/device-tree/model)

bash          


        
2条回答
  •  遥遥无期
    2021-01-01 15:32

    If you just want to delete the null byte:

    model=$(tr -d '\0' < /proc/device-tree/model)
    

提交回复
热议问题