LoginSignup
0
0

More than 3 years have passed since last update.

sedコマンド で、-iオプションと-eオプションを付けたときに不要なファイルができるバグ

Posted at

問題

例えば以下を実行すると

sed -i -e 's/# gem "rails"/gem "rails"/' ./Gemfile

Gemfile-eという名前の不要なファイルが作成されてしまうんですね。

解決策

-iオプションの後ろに、""を入れます。

sed -i "" -e 's/# gem "rails"/gem "rails"/' ./Gemfile

0
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
0
0