short date in bash PS1 prompt
Try including \D{%d.%m.%Y}. You can use any time format supported by strftime(3).
Try including \D{%d.%m.%Y}. You can use any time format supported by strftime(3).
For people looking for a much simpler solution and don’t need the name of the first directory in the path, Bash has built-in support for this using the PROMPT_DIRTRIM variable. From the documentation: PROMPT_DIRTRIM If set to a number greater than zero, the value is used as the number of trailing directory components to retain … Read more
You need a backslash on the $ so it isn’t expanded immediately. (Compare to the `…`, which is a different way of writing $(…).) export PS1=”${RESET}${YELLOW}\u@\h${NORMAL} \`${SELECT}\` ${YELLOW}\w \$(__git_ps1) >${NORMAL} ” I would agree with @MikeSep about using single quotes, but it’s actually a bit more optimal to let the colors and such be substituted … Read more
You’ve installed the version of git-completion.bash from master – in git’s development history this is after a commit that split out the __git_ps1 function from the completion functionality into a new file (git-prompt.sh). The commit that introduced this change, which explains the rationale, is af31a456. I would still suggest that you just source the version … Read more