有时我会使用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
那么它只替换第一次出现的内容。如何使它替换所有出现的内容呢?
<code>bash --version
GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin10.0)
Copyright (C) 2007 Free Software Foundation, Inc.
</code>