how to match end of line in bash history expansion -


For example, provide better support for the history expansion:

  ! $ = & Gt; Along with this, we can use the replacement with  man bash :  
  echo onetwoone echo! $: S / a / three / = & gt;   

First of all, I consider it a syntax similar to sed , but it is not. I can not find any way to match the back end of the string.

  echo onetwoone | Sed 's / a $ / three /' = & gt; Onetwothree   

I would like to do the same thing with the expansion of Bash's history:

  Resonance resonance! $: S / one $ / three = = & gt; -Bash :: S / A $ / three /: replacement failed   

Is there any way to do this? Thanks!

It seems that the modifier does not understand regular expressions.

may be used to: $ sed / a $ / three / '& lt; & Lt; & Lt; $ (Echo! $) Sed / a $ / three / '& lt; & Lt; & Lt; $ (Echo onetwoone) onetwothree


You may also want to refer to fc which you can click on history and Open it in an editor (based on $ EDITOR ) where you can manipulate the desired:

  fc [-e ename] [-lnr] [first] [ Last] FC-S [Pat = Rep] [SemiD] Fix command First, many boundaries from the first to the last are selected from the history list. The first and the last can be specified as a string (to find the last command introduced with that string) or as a number (an index in the history list, where a negative number is offset from offset Used in the form) Rental order number). If the last is not specified then it is set to the current command for the list (hence 'FC-L-10' print the last 10 commands) and otherwise otherwise. If not the first space ???? Ified is set to last order for editing and for listing -16. When the -n option suppresses the command numbers in the list -r option reverses the command command if the -l option is given, the commands are listed on the standard output. All other ???? The intelligent, anonymous editor given by anam is applied to those files of command if the NAM is not provided, then the value of the FCIDIT variable is used, and if the value of the ADITOR is not set, then the FCIDIT is not set. If no variable is set, then vi is used. When is editing ???? The complete, edited commands are echoed and executed. In the second form, the command is re-executed after each instance of Pat, being replaced by a delegate. A useful nickname for experimenting with it is `` R = "FC-S" '', hence the last command that starts with `` "RCC" typing "CC" and "R" typing again Runs last com ?? Bunk    

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -