1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【Mac】sed: RE error: illegal byte sequence 対処法

Posted at

状況

sedコマンドを次のように実行した際に表題のエラーが発生しました。

$ grep -lr 'sample' . | xargs sed -i '' "s/sample/SAMPLE/g"
sed: RE error: illegal byte sequence

対処法

sedコマンドを実行する際にロケール設定を変更することでエラーが発生しなくなります。

grep -lr 'sample' . | LC_ALL=C xargs sed -i '' "s/sample/SAMPLE/g"
1
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?