Skip to content

Instantly share code, notes, and snippets.

@bobthecow
Created October 13, 2011 18:57
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bobthecow/1285149 to your computer and use it in GitHub Desktop.
Save bobthecow/1285149 to your computer and use it in GitHub Desktop.
source ~/.rprompt.bash
export RPROMPT='$(date)'
#!/bin/bash
#
# zsh style right prompt support :)
__rprompt() {
printf "%*s\r" "$COLUMNS" "$(eval echo "$RPROMPT")"
}
if [[ ! $PROMPT_COMMAND =~ __rprompt ]]; then
export PROMPT_COMMAND="__rprompt; ${PROMPT_COMMAND:-:}"
fi
@trey
Copy link

trey commented Jun 25, 2015

If you want to customize the date formatting, do something like this:

export RPROMPT="\$(date '+%b %d %r %Z')"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment