LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 03-20-2010, 09:52 AM   #1
yogesh605
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, 10:57 AM   #2
troop
Member
 
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

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

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

Rep: Reputation: 22
Quote:
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 :
Code:
export PS1="\u@\h:\w$ "
 
  


Reply


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 10:39 PM
how to copy drive using dd and tee command parallely? source code of dd command mdfakkeer Linux - Software 1 02-10-2010 01: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 02:14 AM
LXer: The Linux Command Shell For Beginners: Fear Not The Command Line! LXer Syndicated Linux News 0 12-22-2008 06:30 PM
startx command in FC7 reverts me back to the command prompt sriram87 Linux - Newbie 5 01-03-2008 11:18 PM


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

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