3 ms·
This is how autojump does it: export PROMPT_COMMAND="$AUTOJUMP ; ${PROMPT_COMMAND:-:}"
by joelthelion 15y ago
This is how autojump does it:
export PROMPT_COMMAND="$AUTOJUMP ; ${PROMPT_COMMAND:-:}"
- pavel_lishin 15y agoMy bash-fu is weak; can you break that down for me?
- zakj 15y ago${VARIABLE:-value} expands to the contents of $VARIABLE, if it exists, or to "value" otherwise. In this case value is ":", a bash builtin that does nothing. Effectively, the above sets PROMPT_COMMAND to run the autojump command, then to run the pre-existing PROMPT_COMMAND, if any, or a no-op.