LoginSignup
1
1

More than 5 years have passed since last update.

"warning: command substitution: ignored null byte in input"の対処法

Posted at

bash 4からは、外部コマンド呼び出しの結果をキャプチャする際に、 ($(command)とかのあれ) 出力にヌルバイトが含まれていると警告が出るようです。

ヌルバイトはターミナル上では目に見えないので、出力のどこにヌルバイトが潜んでいるのかは、結果のバイナリを直接見るのがよいでしょう。

command | hexdump -C

ヌルバイトを出力しないようにすれば、表題のwarningは消えるはずです。

参考 https://stackoverflow.com/questions/46163678/get-rid-of-warning-command-substitution-ignored-null-byte-in-input

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1