LoginSignup
0
0

More than 1 year has passed since last update.

replaceコマンドを用意しよう

Posted at

はじめに

PHPerにはsedの正規表現は性に合わないから最近はどのOSにもPerl入ってるってことで、ファイルの文字列置換にはperlを使うんですが、いつもオプションを忘れて毎回ググってるんですよね。。
ってことでreplaceをaliasに登録しておきましょう。

~/.bash_profile(.zprofile)
alias replace='perl -pi -e'

実行例

replace 's/localhost/db/g' config/database.yml

おわりに

Windowsにはreplaceコマンドってのがあったんですね。使ったことないけど。

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