Subject: Re: coupl'a silly questions (and another)
From: Patrick Smith (patsmith@pobox.com)
Date: Sat Aug 25 2001 - 11:53:43 MDT
Scott Frankel wrote:
> Under tcsh: alias new 'ls -lt \!* | head'
> So ... anyone know the bash magic to pass an argument from the
> commandline. Seems like this should be so clear; but it's still
> eluding me. Maybe I *should* change back to tsch ;)
From the section on aliases in the bash man page:
There is no mechanism for using arguments in the replacement
text. If
arguments are needed, a shell function should be used (see
FUNCTIONS
below).
So write it as a function:
new() { ls -lt ${@+"$@"} | head; }
-- patsmith@pobox.com
This archive was generated by hypermail 2a24 : Sat Aug 25 2001 - 11:02:23 MDT