|
NetBSD Installation and Upgrading Have trouble getting NetBSD on your toaster? |
|
Thread Tools | Display Modes |
|
|||
Nicer Prompt with ksh on 5.0
Hi there,
as I am trying out NetBSD 5.0 I would like to use a little more functional prompt in the ksh. My problem: ksh under NetBSD is fairly different from ksh under OpenBSD. While under OpenBSD all I had to do was putting something like: Code:
export PS1='$PWD $ ' Code:
XTerm*loginShell: true So, I know it's a question on a very low level, but I haven't found any working hint up to now: Can you give me a hint on how I can change the prompt of the ksh? |
|
|||
Both NetBSD and OpenBSD have implementations based on pdksh, each has their own customizations.
PS1 on NetBSD's ksh doesn't support the special backslash characters that are supported by OpenBSD's ksh and GNU's bash.. but you're not making use of them. Make sure you reload the .Xdefaults file, or restart X. $ xrdb -load ~/.Xdefaults Hope that helps. |
|
|||
Hey folks, thanks for your advice!
s0xxx, I put this in my ~.profile: Code:
export PS1='@$PWD $' Quote:
|
|
||||
Actually no idea. You don't even have the $HOST in PS1 (if what you wrote is correct). Try logging out, and in again.
__________________
The best way to learn UNIX is to play with it, and the harder you play, the more you learn. If you play hard enough, you'll break something for sure, and having to fix a badly broken system is arguably the fastest way of all to learn. -Michael Lucas, AbsoluteBSD |
|
|||
So now we are two
Quote:
You are right, I don't have the $HOST in PS1 because $HOST has been set by default. The reason? I think, it's because I have the following entry in my /etc/rc.conf: Quote:
Quote:
So, was this wrong? |
|
||||
Are you saying that since you put that entry in rc.conf the prompt has started showing hostname in it?
Setting hostname in rc.conf should have nothing to do with setting PS1 prompt. Check your .profile, .kshrc or similar for any entry that you might have forgot, concerning PS1.
__________________
The best way to learn UNIX is to play with it, and the harder you play, the more you learn. If you play hard enough, you'll break something for sure, and having to fix a badly broken system is arguably the fastest way of all to learn. -Michael Lucas, AbsoluteBSD |
|
|||
Quote:
Funny thing, isn't it? |
|
||||
I was facing the same issue here, where my hostname was getting arbitrarily inserted into the prompt.
The issue, i found out was the ".shrc" file in the home directory. This file pulls in another file "/etc/shrc". If you have a look at "/etc/shrc", you'll find it performs a lot of tomfoolery with PS1 (including inserting the hostname), editor keybindings, etc. I didn't find anything useful being done by these scripts, so i renamed ".shrc" to ".shrc_old". That gave me back the prompt i wanted (without the hostname), and as a bonus my keybindings of the editor to vi also got picked up instead of being ignored. FYI, $ uname -spr NetBSD 5.0.1 x86_64 |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
changing custom prompt ksh for root. | bsdnewbie999 | OpenBSD General | 7 | 1st April 2009 04:53 AM |
Exec command in zsh prompt? | bsddaemon | General software and network | 2 | 18th October 2008 09:37 PM |
what to do at mountroot prompt? | Sunsawe | FreeBSD General | 13 | 5th June 2008 08:06 AM |