【发布时间】:2010-02-17 13:03:31
【问题描述】:
偶尔我会使用 bash 命令来替换之前命令中的字符串:
^foo^bar
今天我想在以下行中进行替换,以将所有出现的checkbox 替换为 `radio:
$ git mv _product_checkbox_buttons.html.erb _product_checkbox_button.html.erb
$ ^checkbox^radio
git mv _product_radio_buttons.html.erb _product_checkbox_button.html.erb
所以它只替换第一次出现。如何让它替换所有出现的地方?
bash --version
GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin10.0)
Copyright (C) 2007 Free Software Foundation, Inc.
【问题讨论】: