Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 03-20-2010, 10:52 AM   #1
LQ Newbie
Registered: Mar 2010
Distribution: mandriva 2010
Posts: 29

Rep: Reputation: 15
Smile su command

when i type su command following error comes error is:"bash: __git_ps1: command not found". what is problem?
Old 03-20-2010, 11:57 AM   #2
Registered: Feb 2010
Distribution: gentoo, arch, fedora, freebsd
Posts: 379

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

Last edited by troop; 03-20-2010 at 11:58 AM.
Old 03-20-2010, 12:29 PM   #3
Registered: Oct 2002
Posts: 138

Rep: Reputation: 22
Originally Posted by yogesh605 View Post
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 :
export PS1="\u@\h:\w$ "


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Is command line invocation of gnome-terminal to run more than one command possible? narnie Programming 4 02-17-2010 11:39 PM
how to copy drive using dd and tee command parallely? source code of dd command mdfakkeer Linux - Software 1 02-10-2010 02:31 PM
URGENT! Is there any command to get a history command lines and time in SUSE Linux.? igsoper Linux - Software 5 06-25-2009 03:14 AM
LXer: The Linux Command Shell For Beginners: Fear Not The Command Line! LXer Syndicated Linux News 0 12-22-2008 07:30 PM
startx command in FC7 reverts me back to the command prompt sriram87 Linux - Newbie 5 01-04-2008 12:18 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:11 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration