加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

bash – Unix命令行历史替换^ foo ^ bar(用于多个替换)

发布时间:2020-12-15 19:44:46 所属栏目:安全 来源:网络整理
导读:偶尔使用bash命令替换上一个命令中的字符串: ^foo^bar 今天我想用下面的代替替换所有出现的复选框与`radio: $ git mv _product_checkbox_buttons.html.erb _product_checkbox_button.html.erb$ ^checkbox^radiogit mv _product_radio_buttons.html.erb _pr
偶尔使用bash命令替换上一个命令中的字符串:
^foo^bar

今天我想用下面的代替替换所有出现的复选框与`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.
男人bash说^ old ^ new相当于!!:s / old / new /。你想!!:gs / old / new /来全局替换。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读