On bash, is there any simple way to run a command every time another command is entered in your shell?
I know about 'trap ... DEBUG', but unfortunately it does not run the specified code for every command. For example:
$ trap 'echo "COMMAND: $BASH_COMMAND"' DEBUG
$ ls
COMMAND: ls --color
[output of ls]
But:
$ (for a in `seq 1 10`; do echo -n "$a "; done;)
1 2 3 4 5 6 7 8 9 10
I would like something that'd give me "COMMAND: (for a in ...)", eg, any command inserted at the prompt.