As l0b0 suggests, you can use PROMPT_COMMAND
to do your second request and you won’t have to touch PS1
.
To do your first request, you can trap
the DEBUG
pseudo-signal:
trap 'echo "foobar"' DEBUG
As l0b0 suggests, you can use PROMPT_COMMAND
to do your second request and you won’t have to touch PS1
.
To do your first request, you can trap
the DEBUG
pseudo-signal:
trap 'echo "foobar"' DEBUG