[SOLVED] Bash Syntax Error in Terminal: Byobu Remnants Left Behind
elementary OSThis forum is for the discussion of elementary Linux. Note: This forum does not have any official participation.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Bash Syntax Error in Terminal: Byobu Remnants Left Behind
Hi:
After installing Byobu (terminal emulator) I removed it as it wasn't what I wanted. Since removing it this error appears each time I launch the konsole.
Code:
bash: /home/sifu/.bashrc: line 169: syntax error: unexpected end of file
I am not familiar with byobu, but I think your error probably derives from the block above the line you commented out (which does not itself look right).
Could you post a larger chunk off the end of your .bashrc and we'll see what we can figure out!
Here's more of my .bashrc. Let me know if you need me to post more.
Code:
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
# Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
# If this is an xterm set more declarative titles
# "dir: last_cmd" and "actual_cmd" during execution
# If you want to exclude a cmd from being printed see line 156
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\$(print_title)\a\]$PS1"
__el_LAST_EXECUTED_COMMAND=""
print_title ()
{
__el_FIRSTPART=""
__el_SECONDPART=""
if [ "$PWD" == "$HOME" ]; then
__el_FIRSTPART=$(gettext --domain="pantheon-files" "Home")
else
if [ "$PWD" == "/" ]; then
__el_FIRSTPART="/"
else
__el_FIRSTPART="${PWD##*/}"
fi
fi
if [[ "$__el_LAST_EXECUTED_COMMAND" == "" ]]; then
echo "$__el_FIRSTPART"
return
fi
#trim the command to the first segment and strip sudo
if [[ "$__el_LAST_EXECUTED_COMMAND" == sudo* ]]; then
__el_SECONDPART="${__el_LAST_EXECUTED_COMMAND:5}"
__el_SECONDPART="${__el_SECONDPART%% *}"
else
__el_SECONDPART="${__el_LAST_EXECUTED_COMMAND%% *}"
fi
printf "%s: %s" "$__el_FIRSTPART" "$__el_SECONDPART"
}
put_title()
{
__el_LAST_EXECUTED_COMMAND="${BASH_COMMAND}"
printf "\033]0;%s\007" "$1"
}
# Show the currently running command in the terminal title:
# http://www.davidpashley.com/articles/xterm-titles-with-bash.html
update_tab_command()
{
# catch blacklisted commands and nested escapes
case "$BASH_COMMAND" in
*\033]0*|update_*|echo*|printf*|clear*|cd*)
__el_LAST_EXECUTED_COMMAND=""
;;
*)
put_title "${BASH_COMMAND}"
;;
esac
}
preexec_functions+=(update_tab_command)
;;
*)
;;
#esac[ -r /home/sifu/.byobu/prompt ] && . /home/sifu/.byobu/prompt #byobu-prompt#
You can just get rid of that last line entirely, but the esac closes a case block way up the file.
Let me know if that works!
Editing that line the way you posted it worked! Thanks-
I found the original .bashrc. It's stored in /etc/skel.
After comparing the original to the current I see why the line with byobu-prompt wasn't needed.
Looking into other terminal emulators like Tilda, Terminator and RoxTerm, do you suspect they will create a similar issue with the .bashrc file again? (once installed or removed)
Editing that line the way you posted it worked! Thanks-
I found the original .bashrc. It's stored in /etc/skel.
After comparing the original to the current I see why the line with byobu-prompt wasn't needed.
Looking into other terminal emulators like Tilda, Terminator and RoxTerm, do you suspect they will create a similar issue with the .bashrc file again? (once installed or removed)
Glad to hear it!
Honestly, I've never had anything modify my ~/.bash* files, and would probably be horrified if they did!
But I guess that it is actually a common enough customization among non-Slackware distros.
I think based on this experience I would just keep a safe copy of them and run a diff after installing anything that might modify, or mortify them!
What features are you looking for in a terminal emulator, may I ask? I used konsole with KDE 3.x and loved it for the tabbed interface. When I left KDE I tried a few and settled on urxvt (aka, rxvt-unicode).
I am a great fan of urxvt now and use tmux instead of tabbed terms. Over time I arrived at suitable .Xresources for colors and transparency, and tmux configs for tmux things, and am now a happy camper indeed!
Honestly, I've never had anything modify my ~/.bash* files, and would probably be horrified if they did!
That's why I started a thread. I've never seen anything like that happen for one and two I thought it broke the command line interpreter permanently. BTW apt-get remove --purge didn't get rid of all of the files of Byobu. I just found another hidden file. Deleted it of course. There's something oddly bizarre about that emulator.
Quote:
What features are you looking for in a terminal emulator, may I ask?
I'm looking for a terminal that looks nice, has a lot of color, is highly configurable, not to heavy (like Terminator) and less than 15 meg's. Have the ability to be able to split a few windows and so on. A menu that's basic and not a lot of cmd's to memorize to make things work.
I was not familiar with byobu so I just visited their website.
It is a terminal multiplexer, not a terminal emulator as far as I can tell on a quick look. If you have not used a terminal multiplexer before it might make it seem a little strange to you... but still does not excuse borking your config files!
Have you ever tried tmux (tmux = terminal multiplexer) or screen?
Both allow you to split panes, switch between terminals, and group terminals into sessions, attach, detach - lots of fun! And very useful!
If not, I would encourage you to trry tmux and be a little patient until you learn your way around... I think you'll like it.
If your main interest is decorations, it might not be the right one for you, although you can colorize and customize to your heart's content! But if you are looking for useful organization, easy on the eyes and easy to navigate, it would be hard to beat!
Not sure about coffee, but it also makes a nice cup of *tea!
(* if you supply the hot water, cup and tea bag of your choice)
I'm pretty sure tmux is part of the terminal that comes with Gnome terminal.
I'm not sure if tmux in the repos for Elementary or not. If not I'll have to install via the tar.gz. https://tmux.github.io/
From what I can tell tmux and Pantheon-terminal are incorporated together in some terminals. OR at least this one that came with Elementary OS Freya.
Played with RoxTerm for a few minutes on my Slackware pc. It's in the SlackBuilds repo-
Aside from the blinding white background (GTK) the configuration manager is fairly easy to use to set the color schemes.
When I have time I'll install RoxTerm on my Mint box and my Elementary box and take the time to look through the manual.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.