Problem with Bash

Posted on 2011-09-19
Last Modified: 2013-12-26
When I open terminal, bash is complaining:

-bash: {rtf1ansiansicpg1252cocoartf1038cocoasubrtf360: command not found
-bash: /Users/lv/.profile: line 2: syntax error near unexpected token `}'
-bash: /Users/lv/.profile: line 2: `{\fonttbl\f0\fswiss\fcharset0 Helvetica;}'

I have found the .profile file, but have no idea how to edit it to get rid of this error. Any idea? what may be wrong?
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}

\f0\fs24 \cf0 function parse_git_branch () \{\
      git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \\(.*\\)/ (\\1)/'\
PS1="$GREEN\\u@machine$NO_COLOUR:\\w$YELLOW\\$(parse_git_branch)$NO_COLOUR\\$ "}

Open in new window

Question by:lvollmer
  • 3
  • 2
LVL 37

Expert Comment

by:Gerwin Jansen
ID: 36560678
Looks a bit cryptic :)

Try adding ;} at the end of the first line

Author Comment

ID: 36560696
I had tried this earlier and got this wonderful new error:

-bash: {rtf1ansiansicpg1252cocoartf1038cocoasubrtf360: command not found
-bash: /Users/lv/.profile: line 2: syntax error near unexpected token `}'
-bash: /Users/lv/.profile: line 2: `{\fonttbl\f0\fswiss\fcharset0 Helvetica;}'
LVL 37

Accepted Solution

Gerwin Jansen earned 500 total points
ID: 36562428
:) How did you create the .profile?

Try this: copy your text from your question above to a text editor and save it as "profile.rtf", then open your profile.rtf with a rich text editor (Windows: Wordpad / MS Word).

You'll see this:
function parse_git_branch () {
      git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'


PS1="$GREEN\u@machine$NO_COLOUR:\w$YELLOW\$(parse_git_branch)$NO_COLOUR\$ "

Open in new window

Paste the text above to your .profile and it'll work just fine...

Author Comment

ID: 36562480
i think it was auto generated, because I do not recall creating it. I will try this now.

Author Closing Comment

ID: 36562517
jackpot thanks!

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Select2 jquery help 9 74
Email address on web page 4 42
Editing login page in zencart. 2 33
Adding a hidden div to each row in a table 6 62
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now