bin_path=$(pwd)/target/debug/make_prompt PROMPT_COMMAND='make_prompt' make_prompt () { local lastexit=$? local bgjobs=$(jobs | wc -l) local prompt_pref=$($bin_path $lastexit $bgjobs) PS1="$prompt_pref" }