AR# 3476: M1.x EPIC - How do I use the history substitution on the EPIC command line?
M1.x EPIC - How do I use the history substitution on the EPIC command line?
Keywords: EPIC, history, substitution, command line
General Description: The EPIC command line functionality supports the use of history substitution using a syntax similar to CSH.
Valid history operators are: !? - Give help on EPIC history substitution. ! - Give a list of previous commands. !! - Retrieve the previous command. !* - Retrieve the 1st thru last words of the previous command. !^ - Retrieve the first word of the previous command. !$ - Retrieve the last word of the previous command. !<num> - Retrieve previous <num> command. !<txt> - Retrieve the last command whose first word matches <txt> !?<txt> - Retrive the last command with any word matching <txt> !:<num> - Retrieve the <num>th word of the previous command. !:<n1>-<n2> - Retrieve the <n1>th through <n2>th words of the prev cmd. !:s/<p1>/<p2>/g - Substitute <p2> for <p1> on prev cmd. The "g" is optional. Use it to sub all matches of <p1>.
The pattern separator char is whatever follows the '!:s'. Hence, !:s#a#b# is legal.
NOTE: The ':' colon operators may also be used in conjunction with the '!<num>' and '!<txt>' operators.
Examples: '!110:s/a/xxx/' or '!select:s/signal1/signal2/'.