Bash prompt is over lapping


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Bash prompt is over lapping
# 1  
Old 11-03-2014
RedHat Bash prompt is over lapping

Hello Guys,

I have facing problem with linux shell prompt .Am expecting my Bash prompt to be like below

Code:
[root@Servername tmp]

but its showing like

Code:
~]$ ot@Servername

and while typing the commands the prompt looks like below:

Code:
 ~]$ echo $PS1
[\u@\h \W]$
 ~]$ ot@Servername

Checked the .bash_profile and also changed the PS1 variable value but still its not working

can some one please help me on this.
# 2  
Old 11-03-2014
What shell and OS are you using? Show us the code you're using to set PS1. You have somehow included a carriage return character in PS1.
# 3  
Old 11-03-2014
Hello ,

Please find the requested info:

Code:
cat  /etc/redhat-release
Red Hat Enterprise Linux Server release 6.5 (Santiago)
#######
 echo $SHELLp02
/bin/bash
##########
 cat .bash_profile
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi
# User specific environment and startup programs

PATH=$PATH:$HOME/bin
export PATH
unset USERNAME
#export PROMPT_COMMAND='echo -ne "\033]0;`hostname`-`whoami`\007"'
 export PS1="\u@\h:\w\$ "

# 4  
Old 11-03-2014
The PS1 you're echoing does not match the one in the .bash_profile:

Code:
echo $PS1
[\u@\h \W]$

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

Where's the previously posted coming from?

Better yet, test the problem by just entering PS1='[\u@\h \W]$ ' in the current session
# 5  
Old 11-03-2014
Code:
:~$ ot@Servername
:~$ PS1='[\u@\h \W]$ '
 ~]$ ot@Servername

Tried above one but still its not working the whole command is clubbing with Prompt text not sure what is wrong.
# 6  
Old 11-03-2014
Mayhap the <CR> is in the servername?
# 7  
Old 11-03-2014
Try " rather than ' for PS1.
Hope this helps

EDIT:
Wont change a thing...
Why do i always, at just such times, an unusal behaviour?

Last edited by sea; 11-03-2014 at 07:53 PM.. Reason: Read note from done, and wanted to reproduce... must have had a buged shell...
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Autojump with modified bash prompt

I use the .bashrc file from this thread. Direct link to the archive containing the ultimate bashrc I am trying to use autojump, but it will not autoload the directories to the autojump list as the custom prompt is not compatible. Here is the thread on the issue from other users. apt -... (2 Replies)
Discussion started by: genehunter
2 Replies

2. Shell Programming and Scripting

Running an executable from bash prompt

Hi, I'm trying to run a program from the bash prompt and I don't understand why it is returning with an error. Dig is my C program, and it takes in parameters J4, detect, 3 and 0182F98E var1="cygdrive/c/2i/test fixture/software/mccdaqtest/debug/Dig J4 detect 3 0182F98E" when I do ... (6 Replies)
Discussion started by: oahmad
6 Replies

3. Shell Programming and Scripting

How to (GUI) prompt for password from bash?

I remember there was a gnome only command that we could insert in a bash script to mount a Linux disk that would pop up a little window to grab a password. I know there are bash commands to read a string but they are not GUIs and they echo the characters typed. This gnome command popped up a... (1 Reply)
Discussion started by: siegfried
1 Replies

4. Emergency UNIX and Linux Support

Bash answer prompt

I am working with a script to simplyfy some operations where I work, but one of the programs needs me to enter a password. It will as me "Please enter the administrator password:" Is there a way to make a bash script to automatically answer the question with the needed password? I am looking... (3 Replies)
Discussion started by: noratx
3 Replies

5. Shell Programming and Scripting

BASH: Getting titlebar and prompt to 'sync up'

This is an instance of "if it's not one thing, it's another." I recently fell victim to my own stupidity in trashing, by accident, my long-running and very highly-customized .bash_profile and .bashrc files for Cygwin & Cygwin/X. I had backups from a previous "go" with this, and decided to use... (0 Replies)
Discussion started by: SilversleevesX
0 Replies

6. OS X (Apple)

Bash prompt wraparound

I'm using a custom prompt with PS1 in my .profile. It is PS1="\\u@\e\:\W\ \\$\ \" and it works well, as you can see, http://content.screencast.com/users/killer54291/folders/Jing/media/2b3db52a-ebf7-43e2-95cc-f45dadbc2b98/00000023.png but, when i type more than the width of the window, it... (0 Replies)
Discussion started by: killer54291
0 Replies

7. UNIX for Advanced & Expert Users

Bash conditional prompt?

Hi, Does anyone know any way of making bash prompt extended with conditional content? Example: export PS1="] && echo '#' || echo '\$'" # This won't work - prompt is not executed # export PS1="\$" # This is an existing but also working equivalent I would like to use more complex... (8 Replies)
Discussion started by: adderek
8 Replies

8. Shell Programming and Scripting

How can i change my bash prompt ?

It looks like, user@hostname:/auto/home3/user$ Desired, user@hostname$ I added following line in .bashrc, but still its same. export PS1=" $ " Please help me :confused: (13 Replies)
Discussion started by: admax
13 Replies

9. Shell Programming and Scripting

Works from bash prompt, but not from script!

I'm trying to use unison from bash on windows with cygwin. I don't know if this is a cygwin question, bash question or unison question. Since I always get reprimanded by the cygwin mailing list for assuming it is a cygwin problem, I'll assume it is a bash question. The following commands work... (7 Replies)
Discussion started by: siegfried
7 Replies

10. UNIX for Dummies Questions & Answers

customize my prompt in bash

in csh I was using: set prompt=""$HOSTNAME".tk.\!> " to customize the look of my prompt. I have seen the light after reading the perils of csh scripting and wish to switch to bash. How do I customize my bash prompt??? I've tried many variation of the above w/no success, and searching this... (2 Replies)
Discussion started by: yankee428
2 Replies
Login or Register to Ask a Question