Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to use realiser to know if I should have used an alias each time I run a command in my bash terminal.

The README gives the following example for ZSH:

function last_command() {
  echo `history -1 | cut -d ' ' -f 3-20 | realiaser`

RPROMPT='%{$fg[$NCOLOR]%}%p $(last_command)%{$reset_color%}'

It says "Check the options on your machine for "history". This configuration is for ZSH and needs slight ajusting for Bash or other configuartions" but I can't find how to adapt it for my bash, I currently have the following but don't know how to adapt it:

function parse_git_branch {
  git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
function prompt {
 \$ "
share|improve this question
up vote 1 down vote accepted

You don't need the function prompt, for setting up PS1. Just export PS1 in your profile. You can use the same last_command function from the ZSH example and stick it in your PS1.

export PS1='${TITLEBAR}\w $(parsebranch) $(last_command) \$'
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.