I frequently search for changes with history | grep 'string'I get a list of commands in my history, along with the history line number), e.g.history | grep 'git'  755  git status 1535  git push origin master 1570  git merge origin/one-146 1667  git reset --hard origin/masterI can now recall and execute a command in one go with !nnn, for example:!755git status# On branch masternothing to commit, working directory cleanMy question is: How can I recall a numbered history command and stay on the commands line for editing and not execute it right away 'as is', the way that ! does, so that I can change a couple of things peform presing return?
How can I recall a numbered history command for edit?
bash;command history
I've since adopted another approach to this - using ![line-number]:pThis prints the statement and adds it to history but doesn't actually execute it.  I then do up arrow and change it as desired.I combine this with my hg alias (alias hg='history | grep ') to recall history commands based on some text.Example:$ hg checkout17140   git checkout README.rdoc17143   git checkout master17201   git checkout README.rdoc17204   git checkout master17923   git checkout .bashrc18151   git checkout v311I use this in addition to ctrl-r (reverse history search) because sometimes I prefer to see an immediate list of all the possibilities for a given string rather than just the output on 1 line that ctrl-r shows.  After hg [string] I would then do ![line-number]search_string as in the hg checkout shown above.