confirmation before selecting a command from bash history

while I am in terminal, I can use up arrow key get the history command (e.g., bash build.sh), then I press enter, the bash command immediate run, So I want a confirm on a terminal.

I can glue it a each sh file, but would be better to just stop it at bash terminal level

Asked By: jian

||
trap 'echo Are you sure running $BASH_COMMAND?; read a' DEBUG
Answered By: Ipor Sircer
Categories: Answers Tags:
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.