rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
* alias function in rc
@ 1992-02-11 17:10 malte
  0 siblings, 0 replies; only message in thread
From: malte @ 1992-02-11 17:10 UTC (permalink / raw)
  To: rc

I as a nasty sytem administrator, I'm planning to let csh slowly die
( if the users let me, of course! ). I'd like to make rc the standart shell.
To make life easier for them I wrote a little rc function which provides
the functionality of the common alias definitions. I post it here hoping
you will benefit from it. Let me here of bugs and incompabilities!

fn alias {
	fn deffn {
		name = $^1; shift 1
		newfn = 'fn ' ^ $^name ^ ' { builtin ' ^ $^* ^ ' $* }'
		eval $newfn
	}
	switch( $#* ){
		case 0; whatis | grep '^fn ';
		case 1; whatis $^1;
		case 2; name=() newfn=() deffn $*;
		case 3; echo 'usage:' $0 '[alias_name [''definition'']]' >[1=2]
			return 1
	}
}

Malte.



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1992-02-11 17:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1992-02-11 17:10 alias function in rc malte

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).