[X-Unix] Bash alias help

Kirk McElhearn kirklists at wanadoo.fr
Tue Feb 24 23:43:00 PST 2004


On 2/25/04 5:38 AM, "Brian Medley" <bpm-list-osx-unix at 4321.tv> wrote:

>> I have the following alias for tcsh:
>> 
>> alias dict ?curl -s dict://dict.org/d:\! <#_msocom_1>  :1 | egrep -v
>>  '^22.*|^250.*|^150.*'"
>> 
>> I want to rewrite this for bash, but, as far as I understand, \! doesn't
>> work in bash aliases. Does anyone out there who is a bash expert know if
>> this is correct? If so, how can I get this to work in bash?
> 
> Are you trying to use arguments?  If so, this might be helpful from 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).

Yes, that's what I found. The original tcsh alias has the argument \!. Is
there no way other than using functions? Because then it won't work as an
alias, right? It'd have to be a shell script, and that's something I want to
avoid.
 
 
Kirk
 
        My latest book: How to Do Everything with Mac OS X Panther
                  http://www.mcelhearn.com/htde.html
 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
 . . . . . . .  kirk at mcelhearn.com | http://www.mcelhearn.com  . . . . . .
 . .  Kirk McElhearn | Chemin de la Lauze | 05600 Guillestre | France  . .



More information about the X-Unix mailing list