Just installing ksh and running it didn't create a .kshrc file for me. Oh well! c'est la vie!
What should be in that file? Anything you want set in the shell...
What documentation is there and where do I find it? The man pages are thorough, O'Reilly "Learning the Korn Shell" is a good start too, though as it has a lot in common with borne and bash, there are many sources.
Have a play - "set -o" will list settings (same in bash). I don't have a SuSE distro here and can't check what you get. Here's one I found - I think that the cd replacement is the best bit (also called at the end to set the prompt) - it reminds me of another difference - the internal test operator "[[" which is used a few times. FCEDIT=vi VISUAL=emacs HISTSIZE=1024 _hst=$(uname -n) _tty=$(tty) [[ $_tty = /dev/tty0?/???? ]] && { _hst=$_hst-${_tty#/dev/tty0?/??} } [[ -w / ]] && _ps1=' # ' || _ps1=' $ ' PS4='[$LINENO]+ ' ################################################# # Alias and Shell function definition # # replacing cd builtin # ################################################# unalias cd function _cd { \cd "$@" && { PS1="${PWD#${HOME}/} ${_hst}(\!)${_ps1}(${LOGNAME})" [[ "$PS1" != /* ]] && PS1="~/$PS1" return 0 } } alias cd=_cd ################################################# # Convenience aliases # ################################################# alias h='history' alias j='jobs' alias -x l='ls -al' alias -x la='ls -aC' alias -x ld='ls -CF' alias -x li='ls -ail' alias -x ll='ls -alR' alias -x lr='ls -R' alias -x lt='ls -lrt' alias -x lx='ls -x' alias s='date;who' alias x='exit' ################################################# # Covenience functions # ################################################# function dir { ls -la "$@" | grep "^[ 0-9]*d" ; } function _man { man "$@" | col -bx | pg ; } ; alias man=_man ################################################# # Alias and Shell function definition # # replacing alias builtin # ################################################# unalias alias function _alias { [[ $# -eq 0 ]] && alias | cat -v || alias "$@" } alias alias=_alias ################################################# # Startup commands # ################################################# cd . set -o nolog [[ "$XOPT" = yes ]] && { unset XOPT ; set -x ; } ##################################################################### On Tue, 25 Jan 2000, Fissler, Quinn wrote:
The biggest differences that I encounter between bash and ksh are:
bash surreptitiously replaces "echo" while ksh provides a new function "print" - the reason for not using "/bin/echo" is that they don't all behave the same.
ksh provides new stuff with ${} and $() which aren't supported elsewhere.
The arrows can be made to work but I tend to use "set -o vi" and use the vi commands (as you can in bash too).
One way to get the arrows working with an ANSI terminal is to "set -o emacs" and put:
alias __A='^P' # Cursor up alias __B='^N' # Cursor down alias __C='^F' # Cursor right alias __D='^B' # Cursor left <<
in your .kshrc
I'm a ksh fan!
Quinn -----Original Message----- From: Kenneth Kellum [mailto:kkellum@pacbell.net] Sent: 25 January 2000 14:14 To: Rafael E. Herrera Cc: suse-linux-e@suse.com Subject: Re: [SLE] Shells
Thanks very much.
ksh does work, but I noticed two things: I don't have a ~/.kshrc file and the up-down arrow keys don't scroll though previous commands. I don't think I can live without the latter.
-- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/