Solved

Problem with Bash

Posted on 2011-09-19
5
842 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
  • 3
  • 2
5 Comments
 
LVL 37

Expert Comment

by:Gerwin Jansen
Comment Utility
Looks a bit cryptic :)

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

Author Comment

by:lvollmer
Comment Utility
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 37

Accepted Solution

by:
Gerwin Jansen earned 500 total points
Comment Utility
:) 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
Comment Utility
i think it was auto generated, because I do not recall creating it. I will try this now.
0
 

Author Closing Comment

by:lvollmer
Comment Utility
jackpot thanks!
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
"In order to have an organized way for empathy mapping, we rely on a psychological model and trying to model it in a simple way, so we will split the board to three section for each persona and a scenario and try to see what those personas would Do,…
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
The viewer will learn how to count occurrences of each item in an array.

763 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

9 Experts available now in Live!

Get 1:1 Help Now