hstr
hstr copied to clipboard
PROMPT_COMMAND syntax error
I'm getting the following error with xfce4-terminal:
bash: PROMPT_COMMAND: line 12: syntax error near unexpected token `;'
bash: PROMPT_COMMAND: line 12: `history -a; history -n; history -a; history -n; history -a; history -n; ; printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\~}"; printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\~}"'
There seems to be a lot of duplicates in PROMPT_COMMAND
environment variable. Can you please check (eventually share) .bashrc
/.bash_profile
for PROMPT_COMMAND
changes?
BTW, the problem is with this semicolon: ...history -n; ; printf...
- you just need to find a command that prepends/appends it.
I second to 'antifa-ev'. Using Arch Linux with XFCE, this one works for me: export PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }'history -a; history -n' Although printing it out with echo may still show command duplication but I have no bash error messages due to extra ';' anymore.
That thread helped me , thans