LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-24-2011, 08:33 PM   #1
NewTom
LQ Newbie
 
Registered: Aug 2011
Posts: 3

Rep: Reputation: Disabled
Unexpected EOF while looking for matching `'' in bashrc with several aliases


So it looks like I messed up /etc/bashrc. I can't find the error, which is probably a quote mark in one of my alias lines that doesn't have a matching quote mark. I cannot find anything like that although I've tried.

These are the error messages:

Code:
-bash: /etc/bashrc: line 88: unexpected EOF while looking for matching `''
-bash: /etc/bashrc: line 91: syntax error: unexpected end of file
What's confusing is I had this file on another mac and it was working just fine. That laptop had the previous version of OSX.

Without further ado, here's the contents of my bashrc.

Code:
# System-wide .bashrc file for interactive bash(1) shells.
if [ -z "$PS1" ]; then
   return
fi
PS1='\h:\W \u\$ '
# Make bash check its window size after a process completes
shopt -s checkwinsize
# Tell the terminal about the working directory at each prompt.
if [ "$TERM_PROGRAM" == "Apple_Terminal" ] && [ -z "$INSIDE_EMACS" ]; then
    update_terminal_cwd() {
        # Identify the directory using a "file:" scheme URL,
        # including the host name to disambiguate local vs.
        # remote connections. Percent-escape spaces.
	local SEARCH=' '
	local REPLACE='%20'
	local PWD_URL="file://$HOSTNAME${PWD//$SEARCH/$REPLACE}"
	printf '\e]7;%s\a' "$PWD_URL"
    }
    PROMPT_COMMAND="update_terminal_cwd; $PROMPT_COMMAND"
fi
set -o vi
alias itunes='open /applications/itunes.app'
alias alias sites='pennyarcade  youtube gmail ccsfmail userpanel reader'
alias userpanel='open -ga /applications/firefox.app.app http://forums.somethingawful.com/usercp.php'
alias youtube='open -ga /applications/firefox.app.app http://www.youtube.com/user/MrJivePirate?feature=mhee'
alias reader='open -ga /applications/firefox.app.app http://www.google.com/reader/view/#overview-page'
alias pennyarcade='open -ga /applications/firefox.app.app http://penny-arcade.com/'
alias loveline='open -ga /applications/firefox.app.app http://www.lovelineshow.com/livestream'
alias ccsfmail='open -ga /applications/firefox.app.app http://mail.google.com/a/mail.ccsf.edu/#inbox'
alias gmail='open -ga /applications/firefox.app.app https://mail.google.com/mail/?shva=1#inbox'
alias hills='ssh tbrannan@hills.ccsf.edu'
alias loveline='open -ga /applications/firefox.app http://www.lovelineshow.com/livestream'
alias gmail='open -ga /applications/firefox.app http://mail.google.com/mail/?shva=1#inbox'
alias ccsfmail='open -ga /applications/firefox.app http://mail.google.com/a/mail.ccsf.edu/#inbox'
alias wra='open -ga /applications/firefox.app http://www.wolframalpha.com/'
alias youtube='open -ga /applications/firefox.app http://www.youtube.com/user/MrJivePirate?feature=mhee'
alias userpanel='open -ga /applications/firefox.app http://forums.somethingawful.com/usercp.php'
alias reader='open -ga /applications/firefox.app http://www.google.com/reader/view/#overview-page'
alias pennyarcade='open -ga /applications/firefox.app http://penny-arcade.com/'
alias khan='open -ga /applications/firefox.app http://www.khanacademy.org/'
alias wolframalpha='wra'
alias wra='open -ga /applications/firefox.app http://www.wolframalpha.com/'
alias firefox='open /applications/firefox.app'
alias ical='open /applications/ical.app'
alias scilab='open /applications/scilab.app'
alias autocad='open '/applications/autodesk/autocad 2011/autocad.app'
alias sites='pennyarcade  youtube gmail ccsfmail userpanel reader'
alias pandora='open -ga /applications/firefox.app http://pandora.com/#/'
alias lastfm='open -ga /applications/firefox.app http://last.fm'
alias userpanel='open -ga /applications/firefox.app.app http://forums.somethingawful.com/usercp.php'
alias youtube='open -ga /applications/firefox.app.app http://www.youtube.com/user/MrJivePirate?feature=mhee'
alias reader='open -ga /applications/firefox.app.app http://www.google.com/reader/view/#overview-page'
alias pennyarcade='open -ga /applications/firefox.app.app http://penny-arcade.com/'
alias loveline='open -ga /applications/firefox.app.app http://www.lovelineshow.com/livestream'
alias ccsfmail='open -ga /applications/firefox.app.app http://mail.google.com/a/mail.ccsf.edu/#inbox'
alias gmail='open -ga /applications/firefox.app.app https://mail.google.com/mail/?shva=1#inbox'
alias hills='ssh tbrannan@hills.ccsf.edu'
alias loveline='open -ga /applications/firefox.app http://www.lovelineshow.com/livestream'
alias gmail='open -ga /applications/firefox.app http://mail.google.com/mail/?shva=1#inbox'
alias ccsfmail='open -ga /applications/firefox.app http://mail.google.com/a/mail.ccsf.edu/#inbox'
alias wra='open -ga /applications/firefox.app http://www.wolframalpha.com/'
alias youtube='open -ga /applications/firefox.app http://www.youtube.com/user/MrJivePirate?feature=mhee'
alias userpanel='open -ga /applications/firefox.app http://forums.somethingawful.com/usercp.php'
alias reader='open -ga /applications/firefox.app http://www.google.com/reader/view/#overview-page'
alias pennyarcade='open -ga /applications/firefox.app http://penny-arcade.com/'
alias khan='open -ga /applications/firefox.app http://www.khanacademy.org/'
alias ~='cd ~ ; ll'
alias docs='cd ~/documents ; ll'
alias desk='cd ~/desktop ;ll'
alias apps='cd /applications;ll'
alias downloads='cd ~/downloads;ll'
alias shell='echo $SHELL'
alias tempdir='echo $TEMPDIR'
alias termprogramversion='echo $TERM_PROGRAM_VERSION'
alias termsessionid='echo $TERM_SESSION_ID'
alias commandmode='echo $COMMAND_MODE'
alias sshauthsock='echo $SHH_AUTH_SOCK'
alias usertextencoding='__CF_USER_TEXT_ENCODING'
alias path='echo $PATH'
alias lang='echo $LANG'
alias shlvl='echo $SHLVL'
alias home='echo $HOME'
alias logname='echo $LOGNAME'
alias display='echo $DISPLAY'
alias ll='ls -lAF'
alias c='clear'
alias cc='c;~'
alias ...='cd ../..'
alias b='cd $OLDPWD'
alias rm='rm -iv'
My original plan was to add a line to bashrc that would look like

Code:
sh < path-to/a-list-of-aliases.txt
Or even better

Code:
sh < path-to/a-direcoty-of-text-files-with-aliaes/*.txt
But that never worked. No error messages or anything, it was like those lines weren't there. The text files were similar to whats in my bashrc now.

Thank you!
 
Old 09-25-2011, 01:00 PM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
There are three single quotes in alias autocad.
Quote:
Originally Posted by NewTom View Post
Code:
sh < path-to/a-direcoty-of-text-files-with-aliaes/*.txt
But that never worked. No error messages or anything, it was like those lines weren't there. The text files were similar to whats in my bashrc now.

Thank you!
This doesn't work because you execute the text files inside the directory and they run in their own subshell. Once terminated the environment is lost. To retain aliases in your parent shell, you have to source them, e.g.
Code:
. path-to/a-direcoty-of-text-files-with-aliaes/*.txt
 
1 members found this post helpful.
Old 09-25-2011, 07:59 PM   #3
NewTom
LQ Newbie
 
Registered: Aug 2011
Posts: 3

Original Poster
Rep: Reputation: Disabled
I removed the lines and lines of aliases from bashrc per your suggestion Colucix. It now has the line

Code:
. ~/aliasworks/bashrcexecutes/*.txt
This helped me find the bungled quote mark.

I'm still having a problem where its only getting 16 out of the 80 or so aliases I'd like to have. This is the error message I'm getting:
Code:
-bash: alias: alias: not found
Very cryptic.
 
Old 09-25-2011, 08:01 PM   #4
corp769
LQ Guru
 
Registered: Apr 2005
Posts: 5,817

Rep: Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002
Quote:
Originally Posted by NewTom View Post
I removed the lines and lines of aliases from bashrc per your suggestion Colucix. It now has the line

Code:
. ~/aliasworks/bashrcexecutes/*.txt
This helped me find the bungled quote mark.

I'm still having a problem where its only getting 16 out of the 80 or so aliases I'd like to have. This is the error message I'm getting:
Code:
-bash: alias: alias: not found
Very cryptic.
That should be because of the following:
Code:
alias alias sites='pennyarcade youtube gmail ccsfmail userpanel reader'
You need to remove the second alias command.
 
1 members found this post helpful.
Old 09-25-2011, 09:29 PM   #5
NewTom
LQ Newbie
 
Registered: Aug 2011
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thanks corp769.

I'm still having a problem with it after removing the alias alias mistake. There's no more error messages, but it was still only getting 17 of the 72 aliases. I changed bashrc to source to each text file in bashrcexecutes on a different line, and now I get 47 of them. It looks like this:
Code:
. ~/aliasworks/bashrcexecutes/apps.txt
. ~/aliasworks/bashrcexecutes/bookmarks.txt
. ~/aliasworks/bashrcexecutes/cdcommands.txt
. ~/aliasworks/bashrcexecutes/evariables.txt
. ~/aliasworks/bashrcexecutes/generalpurpose.txt
Edit:

[QUOTE=colucix;4481826]There are three single quotes in alias autocad./QUOTE]
I did that because of the space between "autocad" and "2011." When I change the line to
Code:
alias autocad="open /applications/autodesk/autocad 2011/autocad.app"
I get this error on using the command "autocad":
Code:
$ autocad
The files /applications/autodesk/autocad and /Users/tomclark/2011/autocad.app do not exist.
/users/tomclark being whatever my working directory happens to be.
Advice?

Last edited by NewTom; 09-27-2011 at 10:48 PM. Reason: Adress the three single quotes in the autocad alias pointed out by Colucix
 
Old 09-27-2011, 05:47 PM   #6
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian + kde 4 / 5
Posts: 6,834

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
Here's a debugging hint.

Try first removing all the lines that you suspect could be causing problems, and load up a clean, working shell. Then try running each command individually on the command line. If it works correctly, then you can move it back into the bashrc. If not, then you've found one of your errors.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Unexpected EOF in archive Drone1 Linux - Newbie 5 11-09-2006 06:31 AM
[crontab] unexpected EOF G00fy Programming 7 11-01-2006 04:09 AM
G4U unexpected EOF jonax2k5 Linux - Software 1 11-16-2005 12:05 PM
Unexpected EOF Error??? ITJedi Programming 2 07-09-2003 03:01 PM
tar: Unexpected EOF saavik Linux - Newbie 1 04-13-2002 03:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:53 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration