From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Dermot Paikkos Newsgroups: gmane.os.tru64.managers Subject: (Summary) OT: Korn shell questions Date: Wed, 04 Dec 2002 15:23:48 +0000 Sender: tru64-unix-managers-owner@ornl.gov Message-ID: <3DEE1E04.20066.144ADFD@localhost> Reply-To: dermot@sciencephoto.com NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT X-Trace: main.gmane.org 1039015267 20933 80.91.224.249 (4 Dec 2002 15:21:07 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 4 Dec 2002 15:21:07 +0000 (UTC) Return-path: Original-Received: from sws1.ctd.ornl.gov ([160.91.20.101]) by main.gmane.org with smtp (Exim 3.35 #1 (Debian)) id 18JbK6-0005PF-00 for ; Wed, 04 Dec 2002 16:20:26 +0100 Original-Received: (qmail 31184 invoked by uid 5); 4 Dec 2002 15:22:36 -0000 Original-Followup-To: poster Precedence: bulk Original-Received: (qmail 31175 invoked by uid 49493); 4 Dec 2002 15:22:36 -0000 Original-Received: from dermot@sciencephoto.com by sws1 by uid 49491 with qmail-scanner-1.14 (clamscan: 0.51. spamassassin: 2.50-cvs. Clear:SA:0(0.6/5.0):. Processed in 0.433351 secs); 04 Dec 2002 15:22:36 -0000 Original-Received: from unknown (HELO emroute1.cind.ornl.gov) (160.91.4.119) by 0 with SMTP; 4 Dec 2002 15:22:36 -0000 Original-Received: from emroute1.cind.ornl.gov (localhost [127.0.0.1]) by emroute1.cind.ornl.gov (PMDF V6.1-1 #39060) with ESMTP id <0H6L004QTPDF87@emroute1.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Wed, 04 Dec 2002 10:22:35 -0500 (EST) Original-Received: from helios.sciencephoto.co.uk (helios.sciencephoto.co.uk [194.200.237.129]) by emroute1.cind.ornl.gov (PMDF V6.1-1 #39060) with ESMTP id <0H6L00D0UPDD9M@emroute1.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Wed, 04 Dec 2002 10:22:26 -0500 (EST) Original-Received: from dione.sciencephoto.co.uk ([194.200.237.140] helo=dione) by helios.sciencephoto.co.uk with esmtp (Exim 3.16 #3) id 18JbMT-00041i-00 for tru64-unix-managers@ornl.gov; Wed, 04 Dec 2002 15:22:54 +0000 Original-To: tru64-unix-managers@ornl.gov X-Mailer: Pegasus Mail for Windows (v4.01) Content-description: Mail message body Priority: normal Xref: main.gmane.org gmane.os.tru64.managers:2639 X-Report-Spam: http://spam.gmane.org/gmane.os.tru64.managers:2639 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 " ." 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