(Summary) OT: Korn shell questions

From: Dermot Paikkos (dermot@sciencephoto.com)
Date: Wed Dec 04 2002 - 10:23:48 EST


I got lots of replies, thanx to all.
It raised a few questions (and eyebrows). We all have our favourite
shells and some people are quite evangelical about theirs.

For the record the reason for switching shells was to enable me to
have separate history files for each users that su'd to root. If your
interested in the whys and what for's see the August edition of
Sysadmin mag (http://www.sysadminmag.com/). I am not making
any claims that this is a foul proof method to deny root access, but it
may help.

Anyway if you have set -o emacs in your .profile (or in your .kshrc if
you use ENV=/.kshrc) you can use your arrow keys. This seems to
act like the bash shell (at least in my experience). So you can press
the up arrow key and recall all your previous commands which has
always been something I liked about bash. You can still use vi to edit
your history by setting FCEDIT=/path/to/vi. So I don't have to learn a
new editor as well. You can of course recall a previous command and
editor on the command line too. Or you can use "r n" where n is the
history number of the command.

The above enables the filename completion as well - groovy.

To access the last argument of your previous command use "<ESC>
." That is an escape and a period.

Special thanx to:
Devesh Pant, Gabor Zelenak, Harry Schroedor, Darrly Cook, Bert
Deknuydt and Michael Bradford.

Dp.

======== Original Message ========
Hi Managers,
Sorry if this is a bit off topic but it seemed a good place to start.
I have just moved from csh to ksh and am try to acclimatize. There
are
a couple of features that I am really missing but think there is a
similar functions in the korn shell.

1) Recall past command. Is there a similar function to !n (where n is
the history number) in ksh?

2) Filename completion. I read that ESC ESC (just like the csh) should
do filename completion - this doesn't seem to be working for me. My
term is Putty for win32. Does anyone know why?

3) Re-use past arguments. One of my favourite recall commands was
!$
to get the last argument from my previous command. EG: >ls
/var/adm/syslog.dated/current > cd !$ (puts me in
/var/adm/syslog.dated/current Can you do this, or something similar,
in ksh?

Thanx.
Dp.
------- End of forwarded message -------
~~
Dermot Paikkos * dermot@sciencephoto.com
Network Administrator @ Science Photo Library
Phone: 0207 432 1100 * Fax: 0207 286 8668



This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 10:49:01 EDT