![]() |
|
OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below. |
![]() |
|
Thread Tools | Display Modes |
|
|||
![]()
What terminals are available in OpenBSD for a newly installed system? Is there a port for bash and how do i change the default terminal to bash?
|
|
|||
![]() Quote:
Quote:
http://openports.se/shells Quote:
This is also covered in Section 10.17 of the FAQ: http://openbsd.org/faq/faq10.html#rootshell Once you become comfortable with editing the password file, you can change the shell directly. |
|
||||
![]()
Just to chime in, bash is _n_o_t_ a terminal it is a shell.
Programs such as xterm are terminal emulators, the command line level interface through virtual teletypes when you first start the machine without X are 'virtual' consoles (not all that much different from a user point of view). The shell runs in the console or terminal and should hopefully be fairly indifferent to which of them it runs in ;-) PS outside of bash specifics most things people expect of bash are doable in OpenBSDs pdksh implementation. A shell is mostly a shell for the most part unless you want to compare the other end of the pond.
__________________
My Journal Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''. |
|
||||
![]()
Speaking as a long-time user of bash, who has only recently (since 4.2) switched to OpenBSD's ksh, there is nothing I could do in bash that I can't do in ksh.
That's one less port to have to install after a fresh system install. ![]()
__________________
That's nothing a couple o' pints wouldn't fix. |
|
||||
![]()
Install http://openports.se/sysutils/checkbashisms
and run your bash scripts through it. If you want to be portable, you can run [pd]ksh with the POSIX options, much like the /bin/sh link in Linux does. And, beeing OpenBSD stock, ksh code is audited!
__________________
da more I know I know I know nuttin' |
|
||||
![]() Quote:
And that's nothing to scoff at- I believe you could call it a 'best practice' to keep your servers as lean as possible on the application installations. If you can accomplish what you need with what's already installed... then do so. The other thing is that the rest of the OBSD community (as a whole, anyway) uses the default KSH... so you would be in better company using KSH instead.
__________________
Network Firefighter |
|
||||
![]() Quote:
__________________
That's nothing a couple o' pints wouldn't fix. |
|
||||
![]()
OpenBSD as one of the best upgrading mechanism in the *nix world.
pkg_add -ui (man packages) make update clean (man ports) and setting your FETCH_PACKAGES you would first grab the binary update if it exists instead of spending CPU time re-inventing warm water.
__________________
da more I know I know I know nuttin' |
|
|||
![]()
How do i enable this option ( [rooot @ user]$ ) to ksh like in linux does?
|
|
||||
![]()
Just as an example, here is(are) the relevant line(s) from my .kshrc
Code:
export PS1='\[^[[1;36m\]\u\[^[[1;37m\]@\[^[[1;32m\]\h\[^[[0;34m\]\ (\l)\[^[[0m\]:\[^[[0;31m\]\w\[^[[0m\]\$ ' ![]()
__________________
That's nothing a couple o' pints wouldn't fix. |
|
|||
![]() Quote:
My suggestion adding to marcolino's example is to break the string further down into more manageable chunks. What I do is the following: Code:
green='^[[01;32m' yellow='^[[01;33m' blue='^[[01;34m' no_color='^[[0m' prefix="${green}\u${yellow}@${green}\h${yellow}:${blue}\w" char="${yellow} $ ${no_color}" export PS1="${prefix}${char}" |
|
||||
![]()
Let me say that ocicat is correct. Ideally, one should have a simple, easily-read and -maintained config file.
Having said that, I have had the same prompt for 10 years or so. The only time I had to delve back into the escape codes and ANSI colors was when I switched to ksh from bash. Once I figured out how to get the colors I wanted, I did not take the time to clean it up with variables. Shame on me and my laziness. ![]() Once I get the time, I will probably do so. However, with the way my time has been lately, that probably won't be for a while. But, yes, I advise to break the codes down into variables like ocicat said.
__________________
That's nothing a couple o' pints wouldn't fix. |
|
|||
![]() Quote:
|
|
||||
![]()
I have a VERY dated Stupid Korn Shell tricks which goes through some colorizing.
http://home.nyc.rr.com/computertaijutsu/ksh.html These days, with work being mostly in Linux, I'm used to bash again. On FreeBSD, I still tend to use zsh. Unfortunately, in Fedora at least (my main workstation) sh doesn't seem to be completely POSIX compliant, and I try to make my scripts usable on AIX as well. However, there's another shell, dash, which is supposedly completely POSIX compliant, pretty much like the FreeBSD sh. |
|
|||
![]()
Studying the ksh(1) manpage would be a wise use of time.
|
|
|||
![]()
i added .kshrc file but it doesn't run at startup. I need to run . .kshrc everytime when i start gnome-terminal.
I add the line PS1 to both .profile and .kshrc and it is still the same. |
|
|||
![]()
You don't need it in both .profile and .kshrc, the former is used by login shells.. the latter for interactive. (For the most part, a .profile is all you'll normally need..)
When you define something in your profile, you need to 'export' it. PS1="..." export PS1 or: export PS1="..." After changes, you need to login again... if this doesn't work, please post the relevant section of the files here in [code][/code] tags. |
![]() |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Good Bash/Scripting book? | cwhitmore | Programming | 10 | 22nd December 2017 03:59 PM |
xterm + bash: Make <DEL> delete char under cursor | taylor_venable | OpenBSD General | 7 | 13th December 2008 11:53 PM |
Changing shell to bash | rex | FreeBSD General | 13 | 29th August 2008 03:20 AM |
Can't use bash on chroot'd openssh environment | jploh | FreeBSD General | 2 | 18th June 2008 02:12 AM |