偶尔我用的是bash命令在以前的命令来替换字符串:的Unix命令行历史替换^ FOO ^条(多替换)
^foo^bar
今天我想作以下行更换更换所有出现的checkbox
'收音机:
$ 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.
非常感谢! 在这一点上,bash命令突然显得非常难看,不可读。但是你可以做的很棒! – 2010-02-17 13:56:42
我同意!那绝对属于最后! – dubiousjim 2010-02-17 13:58:44
是的,我很确定你想!!:s/old/new/g,所以在原始提问者的情况下,你想!!:s/checkbox/radio/g – Jim 2010-02-17 17:29:52