Solved

Problem with Bash

Posted on 2011-09-19
5
861 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 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

Report: Liquid Web beats Amazon, Rackspace & More

A study by performance analyst firm Cloud Spectator finds that Liquid Web beats rivals Amazon, Rackspace and DigitalOcean when it comes to website and cloud application performance.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Domain Service Not Responding 14 47
Is sending authentication through SOAP secure? 3 60
Dreamweaver code color same as CS6 or CS2015 2 71
WordPress Page Content Lost 2 50
When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
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.

752 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