Every time I launch terminal, I keep getting this syntax error.
-bash: /Users/Jake/.bash_profile: line 2: syntax error near unexpected token `then'
-bash: /Users/Jake/.bash_profile: line 2: `alias mysql='/Applications/XAMPP/xamppfiles/bin/mysql'if which rbenv >
/dev/null; then eval "$(rbenv init -)"; fi'
How do I fix this?
if you don't want that alias just edit your /Users/Jake/.bash_profile and remove or comment that line with a # at the begininning . If you do want that alias please post your .bash_profile so we can look at what the error is.
Hope it helps
Related
Hi today for unknown reason, if I typed the following command "vim \tab" in bash terminal to hopefully get an auto-completion, I get the following error:
$ vim bash: command substitution: line 22: syntax error near unexpected token `}'
bash: command substitution: line 22: ` }'
This error does not happen if I typed '\tab` at the end of other commands such as 'ls', or even an alias of vim such as 'alias v=vim'.
This error does not happen in another gnome-terminal, either.
Not sure what is causing this (a vim plugin?). Any idea? thanks.
Found the root cause. I created an alias done, and the "done" conflicts with the bash keyword "done". Problem solved by renamed the alias.
For some reason, I get this message
-bash: [: missing `]'
when I open a new terminal, does anyone know why this is happening?
You should check all the scripts that are started by login
.profile
.bashrc
.bash_profile
If other users are affected then also
/etc/profile
/etc/bashrc
In one of them there is a statement calling test with [ without a closing bracket ]. Search for all [ and check if they are properly closed.
I am trying to install OpenCV using the follow tutorial. One of the steps involves the command: source ~/.bash_profile. Running this command gives me the following error:
-bash: alias: vim: not found
-bash: alias: =: not found
-bash: alias: vim -S ~/.vimrc: not found
I have tried to find a solution online but haven't found any related questions. How do I solve this?
You appear to have something like
alias vim = "vim -S ~/.vimrc"
in your .bash_profile, which is interpreted as a request to show the definitions for three different aliases. You need to remove the whitespace, with something like
alias vim="vim -S ~/.vimrc"
I am new to the terminal and have been working towards adding Grunt to my workflow. I am receiving this error in my Terminal and I don't see any missing " in my .profile file.
-bash: /Users/shawnwilliams/.profile: line 4: unexpected EOF while looking for matching `"'
-bash: /Users/shawnwilliams/.profile: line 6: syntax error: unexpected end of file
Here is my .profile (Edited as I provided the wrong file.)
export PATH="$PATH:$HOME/.rvm/bin:/usr/local/bin” # Add RVM to PATH for scripting
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
It looks like you're using a non-ascii double-quote character after /usr/local/bin. Try changing the double quotes to ascii.
The issue is in your .profile, not .bash_profile, as indicated by the error message.
your .profile is sourced in the first line and then bash complains.
Hi Im a newbie to ruby and rails and terminal and I updated to mac os x 10.10 yosimite and these errors started popping up when I open up terminal
-bash: /Users/marklacsamana/.bash_profile: line 4: syntax error near unexpected token `then'
-bash: /Users/marklacsamana/.bash_profile: line 4: `export PATH=${PATH}:/Users/marklacsamana/Development/adt-bundle-mac-x86_64-20140702/sdk/platform-tools:/Users/marklacsamana/Development/adt-bundle-mac-x86_64-20140702/sdk/toolsif which rbenv > /dev/null; then eval "$(rbenv init -)"; fi'
It looks like your .bash_profile file is malformed at sdk/toolsif which. I reckon that should be sdk/tools; if which or simply add a linebreak after tools in front of the if.