Alias command

Jonathan I. Kamens jik at athena.mit.edu
Mon Nov 13 16:48:29 AEST 1989


In article <29537 at iuvax.cs.indiana.edu> bwildasi at silver.bacs.indiana.edu (Ben
Wildasin) writes:
>I would like to modify the rm command so that it first deletes the file, and
>then copies it to my nfs directory. In other words, I would like to know
>how I can create an alias that can be passed arguments.

  RTFM.

  You can use history substitution in an alias.  From the csh(1) man
page:

     Note that the mechanism allows aliases to introduce parser
     metasyntax.  Thus we can `alias print 'pr \!* | lpr'' to
     make a command which pr's its arguments to the line printer.

See the man page to find out how to do other, more specific
substitutions.

  Also, I fail to see how an alias is first going to delete a file,
and *then* going to copy it to your NFS directory.

  Finally, your second sentence (about arguments to aliases) does not
follow directly from the first, and isn't really a restatement "in
other words" of the first question.  The two are related tenuously at
best....

Jonathan Kamens			              USnail:
MIT Project Athena				11 Ashford Terrace
jik at Athena.MIT.EDU				Allston, MA  02134
Office: 617-253-8495			      Home: 617-782-0710



More information about the Comp.unix.questions mailing list