On Thu, Mar 5, 2009 at 10:42 AM, Darrin Chandler
<dwchand...@stilyagin.com> wrote:
> On Thu, Mar 05, 2009 at 10:36:39AM -0800, Bryan wrote:
>> On Thu, Mar 5, 2009 at 9:54 AM, Darrin Chandler
>> <dwchand...@stilyagin.com> wrote:
>> >
>> > Making a non-login shell act as a login shell isn't the best way,
>> > whether you're in an xterm or at console. There are nicer ways to do
>> > what you're after. Ksh, for instance, will process a file given in the
>> > ENV environment variable for *every* shell:
>> >
>> > $ grep ENV ~/.profile
>> > export ENV=$HOME/.kshrc
>> > $ grep PS1 ~/.kshrc
>> > export PS1="\...@\h \w \$ "
>> >
>> > Check the man page for your shell for details about how and when
>> > .profile, ENV, et al are processed. It may take you a few goes to get
>> > things working how you want, but then everything will work right
>> > everywhere without special incantations.
>> >
>> okay, new question: B Why do I have to put PS1 in ~/.kshrc, when I've
>> already put it in .profile? B I have to call another file from
>> .profile, which will then read PS1 from .kshrc? B Is that desired
>> operation? B Seems like redundancy...
>>
>> I've no problem doing it that way. B The UNIX gods are mysterious in some
ways...
>
> No, you are right. Exporting ENV is no different from exporting PS1 in
> the first place.
>
> So the question is back to why PS1 isn't there. Are you using xdm, or
> are you logging in at console and running startx?

logging in to console and issuing "startx".


> If you log in at
> console then your PS1 should be there in your xterm shells without
> making them login shells.

Yea, the console wasn't an issue.  putting the PS1 in .profile worked
for the console.  But when I'd "startx" and go into fluxbox, or fvwm,
or scrotwm, the xterm would show "#" for root or "$" for my login.
I'd gotten tired of accidentally rebooting remote servers without
thinking, and I wanted a cushion, so I wanted my PS1 to at least show
"hostname".

> If you're using xdm (or kdm, ...) you will not
> have a login shell to begin with, and will need to deal with it in
> ~/.xsession (you could source your .profile there).
>
your suggestion worked.  it must be the .kshrc that everything uses.
.profile isn't consulted, but having PS1 in .kshrc is probably the
more "correct" way.  To test .kshrc, I commented my one line "export
PS1='\...@\h \w \$ ' ", open an xterm, and I'm back to "$".  I uncomment
the line in .kshrc, and the prompt comes back in the next window I
open.

thanks for all the help...  I didn't expect to get this kind of
response, though...  I hope this helps someone.

kind regards,
Bryan

Reply via email to