SUMMARY alias in ksh

From: ### SUPERVISOR ### (root@ewi.ch)
Date: Wed Sep 22 1993 - 19:20:09 CDT


Dear gurus

My original question:

> And here's my problem: what's the syntax for \!* in ksh ?
> Or in other words: how can I include the arguments into the alias ?

> alias cd 'cd \!* ; set prompt = "$HOST [$USER] `pwd` \! # "'
> alias ll '/bin/ls -alF \!* | more'
> alias status 'ps -ael | grep \!* | grep -v grep'

As far as I can see now. It wasn't so difficult. That's why I realy say
thank you to all who wrote me.

The solution is allover: use functions instead of aliases !

The result is:

export PS1="$HOST [$USER] \$PWD ! # " /* need no change for cd itself */
ll() { /bin/ls -alF "$*" | more ; }
status() { ps -ef | grep "$*" | grep -v grep ; }

Basic: (From: Patrick O'Callaghan <poc@usb.ve>)

$* = all the arguments
$@ = all the words together as one argument
$# = the number of arguments
$1 = the first argument

Special thank to: (I hope they are all ....)

bill@hobbes.access.com ( Bill Hunter [Sun Instructor / Support])
James J Dempsey <jjd@spserv.bbn.com>
25835-transue <odt@cc.bellcore.com>
joshia@cranium.com.msu.edu (Amaresh R. Joshi)
"(Galen R. Krokum)" <krokumg@ava.BCC.ORST.EDU>
James J Dempsey <jjd@spserv.bbn.com>
syd@dsinc.dsi.com (Syd Weinstein)
Benoit Lefebvre <Benoit.Lefebvre@eng.canadair.ca>
rkh@ucsdev.ucs.att.com (Bob Halloran)
nlf@aluxpo.att.com
Original-aluxpo!nlf (Nelson Fernandez)
nlf@aluxpo.att.com
Original-aluxpo!nlf (Nelson Fernandez)
Dan Stromberg - OAC-DCS <strombrg@hydra.acs.uci.edu>
Chet Ramey <chet@odin.INS.CWRU.Edu>
katkam@fuwutai.att.com
Original-fuwutai!katkam (Anil Katakam +1 201 386 2524)
jdell@maggie.mit.edu
hwang@sunvm1.corp.mot.com (Hao Wang)
>root@ewi.ch (### SUPERVISOR ###)
derekt@pwcs.stpaul.gov (Derek Terveer)
jimc@jts.com
gary@aodc.gov.au (Gary Riseborough [ITO2])
Patrick O'Callaghan <poc@usb.ve>
jamest@sybase.com (James Terry)
vasey@issi.com
Fereydoun Tavangary 503-629-6313 MS CO1-08 <ft@SSD.intel.com>
guy@auspex.com (Guy Harris)
rlg@random.west.sun.com (Randy Gregor)
rwh@nldn.albany.edu (Ron Henderson)
dtb@otto.bf.rmit.OZ.AU (David Bath)
blymn@mulga.awadi.com.AU (Brett Lymn)
kevin@uniq.com.au (Kevin Sheehan {Consulting Poster Child})
ballisti@ifh.ee.ethz.ch
weingart@inf.ethz.ch

-- 
                      ,,,
                     (. .)
+-----------------o00-(_)-00o---------------------------------------+
|                        __	Christoph Rothlin		    |
|                       |__|					    |
|   _______              __	phone:	+1/385'22'11		    |
|  |_______| /\  /\  /\ |  |	direct:	+1/385'21'75		    |
|   _____   / / / / / / |  |	fax:	+1/385'24'25		    |
|  |_____|  \/ / / / /  |  |					    |
|   _______   / / / /   |  |	e-mail:	root@ewi.ch		    |
|  |_______|  \/  \/    |__|	X400:	o=EWI/p=EUNET/a=ARCOM/c=CH  |
|								    |
|  Electrowatt Engineering Services Ltd.			    |
|  Bellerivestrasse 36    P.O.Box    CH-8034 Zurich    Switzerland  |
+-------------------------------------------------------------------+
|    The opinions are mine, not Electrowatt Engineering Services    |
+-------------------------------------------------------------------+



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:08:16 CDT