LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   su command (https://www.linuxquestions.org/questions/linux-newbie-8/su-command-796681/)

yogesh605 03-20-2010 09:52 AM

su command
 
when i type su command following error comes error is:"bash: __git_ps1: command not found". what is problem?

troop 03-20-2010 10:57 AM

you need to source /etc/bash_completion.d/git in your .bashrc to be able to use __git_ps1

http://matthewtodd.org/2010/02/19/bundle-exec-bash.html

nonamenobody 03-20-2010 11:29 AM

Quote:

Originally Posted by yogesh605 (Post 3905552)
when i type su command following error comes error is:"bash: __git_ps1: command not found". what is problem?

'__git_ps1' is (on my system at least) a shell function which is used by bash auto completion - on my Ubuntu system it appears to be defined in '/etc/bash_completion.d/git'.

When does this error pop up. If you are getting it as soon as you switch user and every time you enter a command (i.e. a new prompt is shown) it will be because your PS1 variable is telling the shell '__git_ps1' to set the value of the prompt.

I will hazard a guess (and it is very hazardous, given the sparsity of the information given) and say:
Blank Whoever made changed the prompt (PS1) variable, did so in the global bashrc or profile, however bashcompletion isn't enable for all users and so the function isn't created when they log on. Simple way to fix it is to change the PS1 variable once you have switched users :
Code:

export PS1="\u@\h:\w$ "


All times are GMT -5. The time now is 05:09 PM.