LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 08-20-2008, 10:36 PM   #1
paragkalra
Member
 
Registered: Sep 2006
Location: Nagpur, Maharashtra, India
Distribution: Debian, Ubuntu, Redhat, Fedora, SLES, OpenSUSE, FreeBSD, Mac OS X
Posts: 221

Rep: Reputation: 31
Problems using Putty (FreeBSD)


Hello all,

I am using "putty" to ssh a Freebsd machine. The problem that I am facing is that once I change to bash shell from C shell and I enter recursively into many directories using cd command then every thing I type after the prompt goes onto next line and coincides with the prompt of second line.

e.g.

Quote:
# cd /tmp/one/two/three/four/five/six/seven/eight/nine/ten/
intel:/tmp/one/two/three/four/five/six/seven/eight/nine/ten #

intel:/tmp/one/two/three/four/five/six/seven/eight/nine/ten # cat /etc/apache2/httpd.confintel:/tmp/one/two/three/four/five/six/seven/eight/nine/ten #
How can I stop this behavior of Bash or is it due Putty?

I think what basically I want is the following:

Quote:
intel#
intel#pwd
/
intel# cd /tmp/one/two/three/four/five/six/seven/eight/nine/ten/
intel#
intel#pwd
/tmp/one/two/three/four/five/six/seven/eight/nine/ten/
This should resolve the issue? Any pointers ?
 
Old 08-21-2008, 02:53 AM   #2
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
The prompt is controlled by the environmental variable $PS1. (There are also $PS2, $PS3, and $PS4 for special purposes; see bash man page if interested.)

If "intel" is your hostname, then I think what you want is one of the following:

Code:
PS1='\h\$'
PS1='\H\$'
I suggest trying this interactively to see if it gives you the result you want. Or check the man page for many other options for the string to contain. For example to do a prompt similar to what you currently have, but just show the basename of the directory (i.e. the last part of the path) try:

Code:
PS1='\H:\W\$'
In all of the above, I am assuming that the hash symbol (#) is the result of being root. The above definitions will cause that to change to dollar sign ($) for normal users.

After interactively getting the prompt the way you like it, you can add that line to /etc/profile or ~/.bash_profile as appropriate on the remote machine.

Last edited by blackhole54; 08-21-2008 at 02:57 AM. Reason: typos
 
Old 08-21-2008, 12:30 PM   #3
paragkalra
Member
 
Registered: Sep 2006
Location: Nagpur, Maharashtra, India
Distribution: Debian, Ubuntu, Redhat, Fedora, SLES, OpenSUSE, FreeBSD, Mac OS X
Posts: 221

Original Poster
Rep: Reputation: 31
Thanks blackhole54....the workaround did the trick...........
 
  


Reply

Tags
bash, freebsd, parag, paragkalra, putty


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
problems with PuTTY... jaepi Linux - Networking 3 05-29-2007 01:13 AM
putty,ssh etc problems Braveheart1980 Linux - General 10 01-06-2006 12:46 PM
Putty problems - cannot connect with server TuXspow Linux - Newbie 1 04-11-2005 02:59 PM
Problems with Putty RahulSingh General 6 09-20-2004 07:35 PM
Im currently using PUTTY but having problems setting display ForumKid Linux - General 3 04-09-2002 05:03 PM


All times are GMT -5. The time now is 01:44 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration