0

I've tried to set up a folder called bin in my user directory. Sadly, my first attempt of appending the new directory was incorrect as I missed a ". I tried opening up the .bash_profile to try and delete my first attempt, but due to not really knowing what I was doing when saving I get these errors when I open the bash.

Last login: Mon Dec 23 11:13:39 on ttys000
-bash: /Users/daz/.bash_profile: line 2: unexpected EOF while looking for matching `"'
-bash: /Users/daz/.bash_profile: line 3: syntax error: unexpected end of file
darryls-mini:~ daz$ cat ~/.bash_profile
PATH=$PATH:~/bin"
PATH="$PATH:~/bin"
darryls-mini:~ daz$ 

The first line after cat is the incorrect one. This is the result of me trying to delete the bash_profile file and re-saving it using pico ~/.bash_profile

3 Answers 3

2

The error is in the following:

PATH=$PATH:~/bin"

which is causing the unexpected EOF while looking for matching `"'.

Observe the quoting. You probably wanted to say:

PATH="$PATH:~/bin"
Sign up to request clarification or add additional context in comments.

Comments

1

Why don't you just edit the file and delete the line? Alternatively, this command will do it for you (assuming that your ~/.bash_profile is otherwise empty, as it seems to be in your post):

echo 'PATH="$PATH:~/bin"' > ~/.bash_profile

Comments

1

The error message is telling you what the problem is:

unexpected EOF while looking for matching `"'

You close the quotes without opening them:

PATH=$PATH:~/bin"

Change it to

PATH=$PATH:~/bin

or

PATH="$PATH:~/bin"

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.