Solved

Problem with Bash

Posted on 2011-09-19
5
855 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, 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 37

Accepted Solution

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

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

803 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