mirror of
https://github.com/onceupon/Bash-Oneliner.git
synced 2024-11-25 22:07:01 +00:00
improve caret substitution
adding global replace
This commit is contained in:
parent
922f7d3f4d
commit
68a99bbe7f
@ -65,7 +65,7 @@ Esc + c
|
|||||||
```bash
|
```bash
|
||||||
!!
|
!!
|
||||||
```
|
```
|
||||||
##### Run last command and change some parameter (e.g. last command: echo 'aaa' -> rerun as: echo 'bbb')
|
##### Run last command and change some parameter using caret substitution (e.g. last command: echo 'aaa' -> rerun as: echo 'bbb')
|
||||||
```bash
|
```bash
|
||||||
#last command: echo 'aaa'
|
#last command: echo 'aaa'
|
||||||
^aaa^bbb
|
^aaa^bbb
|
||||||
@ -73,6 +73,11 @@ Esc + c
|
|||||||
#echo 'bbb'
|
#echo 'bbb'
|
||||||
#bbb
|
#bbb
|
||||||
|
|
||||||
|
#Notice that only the first aaa will be replaced, if you want to replace all 'aaa', use ':&' to repeat it:
|
||||||
|
^aaa^bbb^:&
|
||||||
|
or
|
||||||
|
!!:gs/aaa/bbb/
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
##### Run past command that began with (e.g. cat filename)
|
##### Run past command that began with (e.g. cat filename)
|
||||||
|
Loading…
Reference in New Issue
Block a user