Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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 {
PS1="${TITLEBAR}\
\w\$(parse_git_branch)\
 \$ "
}
prompt
share|improve this question
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.