Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Problem with Bash

Posted on 2011-09-19
5
Medium Priority
?
867 Views
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?
{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\margl1440\margr1440\vieww9000\viewh8400\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural

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

Open in new window

0
Comment
Question by:lvollmer
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 38

Expert Comment

by:Gerwin Jansen, EE MVE
ID: 36560678
Looks a bit cryptic :)

Try adding ;} at the end of the first line
0
 

Author Comment

by:lvollmer
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;}'
0
 
LVL 38

Accepted Solution

by:
Gerwin Jansen, EE MVE earned 2000 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)/'
}

RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
NO_COLOUR="\[\033[0m\]"

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...
0
 

Author Comment

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

Author Closing Comment

by:lvollmer
ID: 36562517
jackpot thanks!
0

Featured Post

Looking for a new Web Host?

Lunarpages' assortment of hosting products and solutions ensure a perfect fit for anyone looking to get their vision or products to market. Our award winning customer support and 30-day money back guarantee show the pride we take in being the industry's premier MSP.

Question has a verified solution.

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

Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

721 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