Re: Yikes! Where is my prompt config hiding?

Re: Yikes! Where is my prompt config hiding?

am 10.04.2008 21:23:05 von googlegroups

On Apr 10, 5:39 am, Tom Newton wrote:
> On 2008-04-10, in
> <2b2a6fb0-44d3-456a-86da-75c9e80e4...@m44g2000hsc.googlegroups.co
> m> W. D. wrote:
>
> > On Apr 9, 7:45 pm, Tom Newton wrote:
> >
>
> >> > I am using an old newsreader that won't go back that far, so
> >> > I logged in usingmyGoogle Groups account.
>
> >> > Thanks, again.
>
> >> Okay. In preparation for our next meeting, you could re-read
> >> the thread you started.
>
>
>
>
>
> > It seems that in order to get bash-3.1 to show a commandpromptof
> > "somehost someuser /somedir", this "bash -l" or something like it
> > needs to happen on startup. I've looked through all of these
> > startup related files, and wherever I could added the seemingly
> > approrpriate code. Even though I have read through all of
> > this, it is not apparent to me how to get this behavior.
>
> > When I run this:
>
> > export PS1="\h \u \w# "
>
> > as far as I can tell nothing happens.
>
> > Ditto when I run:
>
> > source /etc/profile
>
> > I don't know if I mentioned that I was running PuTTY, rather than
> > sitting at the console itself. This might make a difference.
> > Definitely
> > not running a GUI.
>
> > All of the other *nix boxes I've played with were fairly easy to
> > massage
> > to this way of behaving. There is something missing about this
> > situation that I don't understand.
>
> You are posting now from a Windows box. And the problem you are having
> is obviously because you are logging into a Nix box with Windows box.

OK. If the problem is obvious, what it the obvious solution?


> I see a lot of this these days.
>
> Such problems are complex enough when dealing with just the Nix operating
> systems. Throw in Windows and you've got a nightmare.

Yeppers.


> I've never used Windows (or Mac) and am not interested in
> learning about it/them.

OK. I can certainly understand that.


> If you ever decide to finally make the switch for real, we'll talk
> again. If you are just going to "play with" Nix, then you'll have
> to talk to someone else.
>
> Right now, I figure you are getting what you deserve.
>
> The wages of sin are blue screens (etc.) :-)
>
> I really need to start checking the headers of posts as a habit,
> and to just start ignoring posts from Windows/Mac boxes unless
> they are from newbies.

Hmmm. I am using a fully functional Windows box. (by the way,
I dislike Gates, Ballmer, as much as the next guy) With this
Windows box, I am trying to find out the easiest way to to get
the command prompt on a CentOS 5 box to work properly.

Much of the transition to *Nix will be through Windows. Gotta
start somewhere.

When I say "play with" it is just a manner of speaking. My
favorite *Nix is FreeBSD. I've apparently helped a lot of people
with my howtos::

http://www.google.com/search?q=install+freebsd+primer
http://www.google.com/search?q=freebsd+shell+configuration
http://www.google.com/search?q=install+samba+on+freebsd
http://www.google.com/search?q=freebsd+%22read+only+file+sys tem%22

If we *nix advocates don't help each other, who will?

Can anyone else help me to automatically show:

somehost someuser /somedir#

Instead of:

bash-3.1#





>
> Tom
>
> --
> The Truth will set you free:http://www.sethcenter.com

Re: Yikes! Where is my prompt config hiding?

am 10.04.2008 22:46:23 von Ed Morton

On 4/10/2008 2:23 PM, W. D. wrote:

> Can anyone else help me to automatically show:
>
> somehost someuser /somedir#
>
> Instead of:
>
> bash-3.1#

Are you asking how to have your prompt display the host name, your login name
and the current directory? If so, here's one way:

function cdprompt
{
\cd ${1:-$HOME}
PS1="`uname`:`logname`:`basename $PWD`> "
}
alias cd=cdprompt

now when you "cd" it'll change "PS1".

Ed.

Re: Yikes! Where is my prompt config hiding?

am 10.04.2008 22:49:29 von Ed Morton

On 4/10/2008 3:46 PM, Ed Morton wrote:
> On 4/10/2008 2:23 PM, W. D. wrote:
>
>
>>Can anyone else help me to automatically show:
>>
>> somehost someuser /somedir#
>>
>>Instead of:
>>
>> bash-3.1#
>
>
> Are you asking how to have your prompt display the host name, your login name
> and the current directory? If so, here's one way:
>
> function cdprompt
> {
> \cd ${1:-$HOME}
> PS1="`uname`:`logname`:`basename $PWD`> "
> }
> alias cd=cdprompt
>
> now when you "cd" it'll change "PS1".

and of course you can export and use UNAME and LOGNAME instead of invoking the
uname and logname tools on every cd, and use ${PWD##*/} instead of basename if
you care...

Ed.