LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > elementary OS
User Name
Password
elementary OS This forum is for the discussion of elementary Linux. Note: This forum does not have any official participation.

Notices


Reply
  Search this Thread
Old 05-25-2016, 10:23 PM   #1
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,484
Blog Entries: 15

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Post 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
So I opened nano and commented this line out.
Code:
#esac[ -r /home/sifu/.byobu/prompt ] && . /home/sifu/.byobu/prompt   #byobu-prompt#
Doing so now gives me:
Code:
bash: /home/sifu/.bashrc: line 170: syntax error: unexpected end of file
Here's a portion of the .bashrc to show where the problem lies.
Code:
# 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#
I ran the apt-get remove --purge cmd to rm Byobu.
Aside from removing the konsole that came with Elementary (which I'd prefer to keep)

How can I fix this in the .bashrc?
 
Old 05-25-2016, 10:48 PM   #2
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,263
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
Hi ZTkitty!

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!
 
1 members found this post helpful.
Old 05-26-2016, 07:02 PM   #3
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,484

Original Poster
Blog Entries: 15

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Hi: astrogeek-

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#
 
Old 05-26-2016, 10:33 PM   #4
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,263
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
Quote:
Originally Posted by Ztcoracat View Post
Hi: astrogeek-

Here's more of my .bashrc. Let me know if you need me to post more.


Code:
...
#esac[ -r /home/sifu/.byobu/prompt ] && . /home/sifu/.byobu/prompt   #byobu-prompt#
Hi ZTcorakitty!

Sorry to be so slow getting back in here!

Well, it looks like that is all OK.

I thought it might be an open block from above, and it was, but it was still just the broken esac line.

Try this, bet it works:

Code:
...
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!
 
Old 05-26-2016, 11:16 PM   #5
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,484

Original Poster
Blog Entries: 15

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Quote:
Originally Posted by astrogeek View Post
Hi ZTcorakitty!

Sorry to be so slow getting back in here!

Well, it looks like that is all OK.

I thought it might be an open block from above, and it was, but it was still just the broken esac line.

Try this, bet it works:

Code:
...
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)
 
Old 05-26-2016, 11:36 PM   #6
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,263
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
Quote:
Originally Posted by Ztcoracat View Post
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!
 
Old 05-27-2016, 12:02 AM   #7
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,484

Original Poster
Blog Entries: 15

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Quote:
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.

Oh, and makes coffee in the morning-
 
Old 05-27-2016, 12:29 AM   #8
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,263
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
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)

Last edited by astrogeek; 05-27-2016 at 12:47 AM.
 
Old 05-27-2016, 09:48 PM   #9
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,484

Original Poster
Blog Entries: 15

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
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.

I've also looked at RoxTerm and Yakuake.

Thank You for your suggestion I'll give it a try.
 
Old 05-28-2016, 12:05 PM   #10
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,484

Original Poster
Blog Entries: 15

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
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.

Thanks again astrogeek for your time and help.-
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Error in Bash: line 77: syntax error: unexpected end of file bribon Programming 8 07-13-2011 12:43 PM
LXer: Linux, Terminal Utility: Screen and Byobu LXer Syndicated Linux News 0 09-30-2010 01:40 PM
bash: syntax error denneyd Linux - Software 3 04-08-2010 08:41 PM
bash, syntax error santana Linux - Software 2 01-23-2008 01:39 PM
BASH : syntax error semaja2 Programming 6 01-26-2006 12:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > elementary OS

All times are GMT -5. The time now is 02:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration