Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I use MsysGit on windows 7. I have one annoying problem. The entire bash_profile file seems to get executed twice. for example, I have the following echo line in the .bash_profile

echo "Boinkk..."

enter image description here

If I have

echo "Calvin..."
echo "Hobbes..."

Then I get enter image description here So I know that the .bash_profile file is getting executed twice and not each statement getting executed twice. The target for the "Git Bash" Executable is

C:\Windows\System32\cmd.exe /c ""C:\Program Files\Software\Git\bin\sh.exe" --login -i"

Does anybody know what I have to do to get the bash shell to execute the bash_profile statements only once?

share|improve this question
1  
because if each statement was getting executed twice, I should have got Calvin... Calvin... Hobbes... Hobbes... –  Prasanth Aug 4 '11 at 8:46
    
Do you have any other rc files like bashrc that source bash_profile? I don't think it would do anything but try removing the -i from your target. –  jw013 Aug 4 '11 at 9:18
    
@jw013 I tried removing -i, didn't help. I also tried removing --login -i, but then .bash_profile didn't get sourced at all –  wisbucky Jan 31 at 0:21
add comment

1 Answer

up vote 1 down vote accepted

I'm not familiar with how to fix on Windows but if it were UNIX/Linux you could do:

echo $PATH <br />

and see where you're getting your double entry from. I'm speculating that your .bash_profile is being added to the path more than once. If you track down where the path is being manipulated you can fix your problem.

share|improve this answer
    
Thanks. Got it fixed –  Prasanth Sep 3 '11 at 10:34
    
@Prasanth Can you share what the fix was? I tried echo $PATH <br />, echo "$0", echo "$BASH_SOURCE" to try to find what was sourcing .bash_profile twice, but no luck. I have no .bashrc files. It appears to me that Git Bash is sourcing ~/.bash_profile twice when it starts. –  wisbucky Jan 31 at 0:44
    
Git bash was sourcing my .bash_profile already. That was my problem. Ive long since moved to a Unix set up. –  Prasanth Feb 3 at 4:45
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.