Mac Terminal Syntax Error
Contents |
Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site mac terminal syntax error near unexpected token About Us Learn more about Stack Overflow the company Business Learn more about
Syntax Error Near Unexpected Token (' Bash
hiring developers or posting ads with us Ask Different Questions Tags Users Badges Unanswered Ask Question _ Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top I get a bash syntax error message every time I open Terminal up vote 0 down vote favorite I've been getting this error for the past couple of months and I wonder if it's a major issue, and how do I fix it? When I open terminal on my Mac I get this bash error: ~bash: /Users/admin/.bash_profile: line 1: syntax error near unexpected token 'fi' ~bash: /Users/admin/.bash_profile:line 1: 'if which rbenv > /dev/null; than eval "$(rbenv init -)"; fi' Anybody know what's going on? macos terminal share|improve this question edited Aug 6 '15 at 5:19 Chris Page 4,2902128 asked Aug 2 '15 at 9:03 dmsquare 1 migrated from stackoverflow.com Aug 2 '15 at 19:08 This question came from our site for professional and enthusiast programmers. Well, that "than" should probably be "then" but I'm not really a scripting expert. (Are you logging in to the "admin" account or is something else referencing the admin profile?) –Phillip Mills Aug 2 '15 at 12:54 Login as admin and start TextEdit. Open .bash_profile and correct the typo. –Mark Setchell Aug 2 '15 at 14:17 There isn't a .bash_profile file in admin? –dmsquare Aug 2 '15 at 14:39 add a comment| 2 Answers 2 active oldest votes up vote 1 down vote Open the Terminal.app and type the following line at your prompt sed -i '' 's/than/then/' .bash_profile You do have a .bash_profile in your home directory. share|improve this answer answered Aug 2 '15 at 19:30
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Mac Terminal problem up vote 1 down vote favorite http://apple.stackexchange.com/questions/198552/i-get-a-bash-syntax-error-message-every-time-i-open-terminal I'm trying to execute this line: cd /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2.1 (8C148)/Symbols but this error pop out: -bash: syntax error near unexpected token `(' How do I resolve this? iphone osx command-line share|improve this question edited Dec 23 '10 at 4:49 Asaph 94.4k16138163 asked Dec 23 '10 at 4:34 Marcell 577 add a comment| 2 Answers 2 active oldest votes up vote 4 down vote accepted You need to either escape http://stackoverflow.com/questions/4515891/mac-terminal-problem the space and both the opening and closing parens with a backslash like this: cd /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2.1\ \(8C148\)/Symbols or quote the path like this: cd "/Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2.1 (8C148)/Symbols" Escaping and quoting seems tedious and annoying, you might say? Rest assured, there is a better way. Power users generally rely on tab completion and don't really think about escaping paths on the command line too much. Try typing the first part of a directory or filename and hit the tab key. You'll see the shell auto-complete as much of the text as possible. If there is still more to type, hit the tab key again and you'll be presented with a list of possible matches based on what you've typed so far. Type more characters to disambiguate and try hitting tab again. Rinse and repeat as necessary. Tab completion will do the escaping for you along the way. share|improve this answer edited Dec 23 '10 at 4:46 answered Dec 23 '10 at 4:40 Asaph 94.4k16138163 add a comment| up vote 0 down vote cd /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2.1\ \(8C148\)/Symbols share|improve this answer answered Dec 23 '10 at 4:36 chaimp 5,13393458 Note the \ before the space and before each of the parentheses. The other way to
communities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have http://askubuntu.com/questions/372926/bash-syntax-error-near-unexpected-token Meta Discuss the workings and policies of this site About Us https://developer.mbed.org/questions/4755/Does-this-work-with-Terminal/ Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Ask Ubuntu Questions Tags Users Badges Unanswered Ask Question _ Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes syntax error a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top bash: syntax error near unexpected token `(' up vote 5 down vote favorite 3 I am trying to download flareget download manager via wget I get error wget http://www.flareget.com/files/flareget/debs/amd64/flareget_2.3-24_amd64(stable)_deb.tar.gz bash: syntax mac terminal syntax error near unexpected token `(' Why is that error coming and what is the solution for that? bash scripts wget share|improve this question asked Nov 8 '13 at 10:27 Registered User 1,17972237 add a comment| 2 Answers 2 active oldest votes up vote 7 down vote accepted You should use single quotes ' or double quotes " around the URL in this case (and in general): wget 'http://www.flareget.com/files/flareget/debs/amd64/flareget_2.3-24_amd64(stable)_deb.tar.gz' From now, you should use this method in general when you use a string which contain parentheses as argument in a command. That is because parentheses are used for grouping by the shell such that they are not communicated in any way to a command. So, the bash shell will give you a syntax error: $ echo some (parentheses) bash: syntax error near unexpected token `(' $ echo 'some (parentheses)' some (parentheses) share|improve this answer edited Nov 8 '13 at 11:40 answered Nov 8 '13 at 10:30 Radu Rădeanu 78.3k24173257 add a comment| up vote 2 down vote It's because of the bracket
with Terminal? Does this work with the default Terminal application on Mac called "Terminal"? I keep getting the output: "syntax error near unexpected token `newline'" Am I doing something wrong? Question relating to: Last updated: 07 Feb 2013 Handbook Mac or Linux terminals I believe it should. I dont have Mac to test it. Did you try the program which is mentioned in the handbook, gnu screen? posted by Martin Kojtal 02 Oct 2014 Comment on this question Please login to post comments. 1 Answer Michel Dubois 12 months ago. Hi, You can use minicom-X for MAC Regards,
Post a comment on this answer Please login to post comments. To post an answer, please login Info Asked 2 years ago. Updated 12 months Related Items Mac or Linux terminals NUCLEO-F401RE driver installation on Mac OS 10.8.5 SerialPC Tags linux mac or terminals © mbed blog we're hiring! support service status privacy policy terms and conditions Important information This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. ARM websites use two types of cookie: (1) those that enable the site to function and perform as required; and (2) analytical cookies which anonymously track visitors only while using the site. If you are not happy with this use of these cookies please review our Privacy Policy to learn how they can be disabled. By disabling cookies some features of the site will not work. Read More accept and hide this message Report Content × Spam Inappropriate Cancel Access Warning You do not have the correct permissions to perform this operation. Please, contact us at support@mbed.com to gain full access. ×