cygwin sed substitution against commands in history -
I can not find an answer to this exact problem, so I will ask it.
I am working in Sigwin and ! I want to refer to the previous commands using the N
notation, for example, if the command was 5, then which ls
, then ! 5
! 5: s / which \ ([az] \) / \ 1 /
should run only LS, or whatever logic it will be for command number 5.
I have tried several ways of this type of replacement and the same error:
bash :: s / jo ([az] * \) / \ / / Replacement failed
This works for me by using Bash in SIGN (note that my which is the LS
command in my history Number 501 was not in the list;
5 like you):
You can also do this like this (which is low / cleaner): $ (! 501 | sed 's You can also do this (which is less / cleaner):
$ (! 5 01 | Sed 's / which //')
Comments
Post a Comment